Skip to main content

A python package to compute a repository best engineering practices indicators

Project description

Build lgtm LGTM Alerts pypi-version pypi-status release-date License python-version

radon-repository-scorer

The radon-repository-scorer is a Python package to compute a repository best engineering practices indicators.

The module provides the following 8 indicators of well-engineered software projects:

  • Core contributors: the number of contributors whose total number of commits accounts for 80% or more of the total contributions.
  • Continuous integration (CI): the repository has evidence of a CI service, determined by the presence of a configuration file required by that service (e.g., a.travis.ymlfor TravisCI).
  • Comments ratio: ratio between comments and lines of code.
  • Commit frequency: the average number of commits per month.
  • Issue frequency: the average number of issue events transpired per month.
  • License availability: the repository has evidence of a license (i.e., a LICENSE file).
  • Lines of Code: the number of executable lines of code.
  • Ratio of IaC scripts: ratio between Infrastructure-as-Code (IaC) files and total files.

All the previous indicators but the last are described in depth in:

@inproceedings{@article{munaiah2017curating,
  title={Curating GitHub for engineered software projects},
  author={Munaiah, Nuthan and Kroh, Steven and Cabrey, Craig and Nagappan, Meiyappan},
  journal={Empirical Software Engineering},
  volume={22},
  number={6},
  pages={3219--3253},
  year={2017},
  publisher={Springer}
}

Note: the tool is intended to be used as a Python library. Therefore, the current version does not provide a command line interface.

How to install

From the Python Package Index

pip install repository-scorer


From source code

pip install -r requirements
pip install .

How to use

from reposcorer.scorer import score_repository

report = score_repository(path_to_repo='path/to/cloned/repo',
                          full_name_or_id='repo_owner/repo_name',  # e.g., radon-h2020/radon-repository-scorer
                          host='github')  # or gitlab

Output

{
  'has_ci': <bool>,
  'comments_ratio': <float in [0,1]>,
  'commit_frequency': <float>,
  'core_contributors': <int>,
  'iac_ratio': <float in [0,1]>,
  'issue_frequency': <float>,
  'has_license': <bool>,
  'repository_size': <int>
}

How to build the Docker image

docker build -t repo-scorer:latest .

How to pull from Dockerhub

docker pull radonconsortium/repo-scorer:latest

How to use Docker image

docker run -e GIT(HU|LA)B_ACCESS_TOKEN=$TOKEN repo-scorer:latest <github|gitlab> <repo full name> <clone to>

Example

docker run -e GITHUB_ACCESS_TOKEN=$GITHUB_ACCESS_TOKEN repo-scorer:latest github UoW-CPC/COLARepo /tmp/

Output:

{"has_ci": false, "percent_comment": 0.0389, "commit_frequency": 4.56, "core_contributors": 3, "iac_ratio": 0.96, "issue_frequency": 0.0, "has_license": false, "repository_size": 2224}

See CHANGELOG for logs detail about releases.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repository-scorer-0.3.3.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

repository_scorer-0.3.3-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file repository-scorer-0.3.3.tar.gz.

File metadata

  • Download URL: repository-scorer-0.3.3.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for repository-scorer-0.3.3.tar.gz
Algorithm Hash digest
SHA256 306345f8a674a2eb08c4984e4b1ce5eed9b2e9b22c4a4386c1387ae941f5d6cd
MD5 ac67be1c0d594c116f39e6dea8ddacd8
BLAKE2b-256 d9c324d0099036818f029f3b36750bfc1f59e2adef1a4bf685e0abada73a40e0

See more details on using hashes here.

File details

Details for the file repository_scorer-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: repository_scorer-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for repository_scorer-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5ca10a32306b020fe540f4234377708a001680cac0e8f829a0626e3c7eeec414
MD5 45b0821c540db57057a74634f9e25a7f
BLAKE2b-256 7fd6bc4a77fd2eb5586df3cb4ffec7271e6d92724bdf319467660e6379d2981e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page