{"id":41372914,"url":"https://github.com/elmotec/codemetrics","last_synced_at":"2026-01-23T09:50:17.318Z","repository":{"id":32423001,"uuid":"130151054","full_name":"elmotec/codemetrics","owner":"elmotec","description":"Multi language library for pandas notebook to mine git and gain insights on your code base.","archived":false,"fork":false,"pushed_at":"2025-11-16T16:09:27.000Z","size":5001,"stargazers_count":16,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-05T21:50:45.313Z","etag":null,"topics":["analysis","code","metrics"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elmotec.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-04-19T02:58:48.000Z","updated_at":"2025-11-16T16:09:28.000Z","dependencies_parsed_at":"2023-01-14T21:09:59.599Z","dependency_job_id":null,"html_url":"https://github.com/elmotec/codemetrics","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/elmotec/codemetrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmotec%2Fcodemetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmotec%2Fcodemetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmotec%2Fcodemetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmotec%2Fcodemetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elmotec","download_url":"https://codeload.github.com/elmotec/codemetrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmotec%2Fcodemetrics/sbom","scorecard":{"id":373643,"data":{"date":"2025-08-11","repo":{"name":"github.com/elmotec/codemetrics","commit":"e065b268c8c8eae5fdd3bce6f1fd29d0a95c3119"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/coverage.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/python-app.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/coverage.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/coverage.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/coverage.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/coverage.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-app.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/python-app.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-app.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/elmotec/codemetrics/python-app.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/coverage.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/coverage.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/python-app.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/python-app.yml:25","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   6 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.11.1 not signed: https://api.github.com/repos/elmotec/codemetrics/releases/36505140","Warn: release artifact v0.10.0 not signed: https://api.github.com/repos/elmotec/codemetrics/releases/35195117","Warn: release artifact v0.11.1 does not have provenance: https://api.github.com/repos/elmotec/codemetrics/releases/36505140","Warn: release artifact v0.10.0 does not have provenance: https://api.github.com/repos/elmotec/codemetrics/releases/35195117"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":6,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Warn: required approving review count is 1 on branch 'main'","Warn: codeowners review is not required on branch 'main'","Warn: no status checks found to merge onto branch 'main'","Info: PRs are required in order to make changes on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-44cc-43rp-5947","Warn: Project is vulnerable to: PYSEC-2021-130 / GHSA-4952-p58q-6crx","Warn: Project is vulnerable to: GHSA-9q39-rmj3-p4r2","Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2013-9 / GHSA-4gv5-qhvr-36vv","Warn: Project is vulnerable to: PYSEC-2021-437 / GHSA-5xp3-jfq3-5q8x","Warn: Project is vulnerable to: PYSEC-2019-160 / GHSA-c5h8-cq4v-cvfm","Warn: Project is vulnerable to: PYSEC-2013-8 / GHSA-g3p5-fjj9-h8gj","Warn: Project is vulnerable to: PYSEC-2020-173 / GHSA-gpvv-69j7-gwj8","Warn: Project is vulnerable to: PYSEC-2023-228 / GHSA-mq26-g339-26xf","Warn: Project is vulnerable to: PYSEC-2022-43017 / GHSA-qwmp-2cf2-g9g6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T13:35:35.581Z","repository_id":32423001,"created_at":"2025-08-18T13:35:35.581Z","updated_at":"2025-08-18T13:35:35.581Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28687084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","code","metrics"],"created_at":"2026-01-23T09:50:14.127Z","updated_at":"2026-01-23T09:50:17.304Z","avatar_url":"https://github.com/elmotec.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://img.shields.io/pypi/v/codemetrics.svg\n    :target: https://pypi.python.org/pypi/codemetrics/\n    :alt: PyPi version\n\n.. image:: https://img.shields.io/pypi/pyversions/codemetrics.svg\n    :target: https://pypi.python.org/pypi/codemetrics/\n    :alt: Python compatibility\n\n.. image:: https://img.shields.io/github/actions/workflow/status/elmotec/codemetrics/python-app.yml\n   :target: https://github.com/elmotec/codemetrics/actions/workflows/python-app.yml\n   :alt: GitHub Actions Workflow Status\n\n.. image:: https://img.shields.io/appveyor/ci/elmotec/codemetrics/main?label=AppVeyor\n    :target: https://ci.appveyor.com/project/elmotec/codemetrics\n    :alt: AppVeyor main status\n\n.. image:: https://img.shields.io/librariesio/release/pypi/codemetrics.svg?label=libraries.io\n    :alt: Libraries.io dependency status for latest release\n    :target: https://libraries.io/pypi/codemetrics\n\n.. image:: https://img.shields.io/readthedocs/codemetrics.svg\n    :target: https://codemetrics.readthedocs.org/\n    :alt: Documentation\n\n.. image:: https://codecov.io/gh/elmotec/codemetrics/branch/main/graph/badge.svg?token=ELJW941FET\n    :target: https://codecov.io/gh/elmotec/codemetrics\n    :alt: Coverage\n\n.. image:: https://img.shields.io/codacy/grade/dd4a11eb66674b3bbe518d8f829b6234.svg\n    :target: https://www.codacy.com/app/elmotec/codemetrics/dashboard\n    :alt: Codacy\n\n\n===========\ncodemetrics\n===========\n\nMine your SCM for insight on your software. A work of love\ninspired by `Adam Tornhill`_'s books.\n\nCode metrics is a simple Python module that leverage pandas and your source control management (SCM) tool togenerate\ninsight on your code base.\n\n- pandas_: for data munching.\n- lizard_: for code complexity calculation.\n- cloc.pl (script): for line counts from cloc_\n- For now, only Subversion and git are supported.\n\n\nInstallation\n------------\n\nTo install codemetrics, simply use pip:\n\n::\n\n  pip install codemetrics\n\n\n\nUsage\n-----\n\nThis is a simple tool that makes it easy to retrieve information from your\nSource Control Management (SCM) repository and hopefully gain insight from it.\n\n::\n\n  import codemetrics as cm\n  import cm.git\n\n  project = cm.GitProject('path/to/project')\n  loc_df = cm.get_cloc(project, cloc_program='/path/to/cloc')\n  log_df = cm.get_log(project)\n  ages_df = cm.get_ages(log_df)\n\n\nTo retrieve the number of lines changed by revision with Subversion:\n\n::\n\n  import codemetrics as cm\n  import cm.git\n\n  project = cm.SvnProject('path/to/project')\n  log_df = cm.get_log(project).set_index(['revision', 'path'])\n  log_df.loc[:, ['added', 'removed']] = log_df.reset_index().\\\n                                           groupby('revision').\\\n                                           apply(cm.svn.get_diff_stats, chunks=False)\n\nSee `module documentation`_ for more advanced functions or the `example notebook`_ where codemetrics is applied to pandas.\n\nThere is also an `example notebook`_ running codemetrics on the pandas code base, and\nthe `example html export`_ of that notebook output (some features are missing like\nthe display of file names when hovering on the circles).\n\nLicense\n-------\n\nLicensed under the term of `MIT License`_. See attached file LICENSE.txt.\n\n\nCredits\n-------\n\n- This package was inspired by `Adam Tornhill`_'s books.\n- This package was created with Cookiecutter_.\n\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _lizard: https://github.com/terryyin/lizard\n.. _pandas: https://pandas.pydata.org/\n.. _cloc: http://cloc.sourceforge.net/\n.. _Pandas documentation: https://pandas.pydata.org/pandas-docs/stable/text.html\n.. _MIT License: https://en.wikipedia.org/wiki/MIT_License\n.. _Adam Tornhill: https://www.adamtornhill.com/\n.. _module documentation: https://codemetrics.readthedocs.org/\n.. _example notebook: https://github.com/elmotec/codemetrics/blob/main/notebooks/pandas.ipynb\n.. _example html export: https://github.com/elmotec/codemetrics/blob/main/notebooks/pandas.html\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmotec%2Fcodemetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felmotec%2Fcodemetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmotec%2Fcodemetrics/lists"}