Skip to main content

A python package to compute a repository best engineering practices indicators

Project description

radon-repository-scorer

The radon-repositoru-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 repositoryscorer import score_repository

report = score_repository(path_to_repo='path/to/cloned/repo',
                          access_token='<GITHUB_ACCESS_TOKEN>',
                          repo_owner='<owner>',   # e.g., radon-h2020
                          repo_name='<name>')     # e.g., radon-repository-scorer

Expected

{
  'repository': path/to/cloned/repo,
  'continuous_integration': <bool>,
  'percent_comment': <float in [0,1]>,
  'commit_frequency': <float>,
  'core_contributors': <int>,
  'iac_ratio': <float in [0,1]>,
  'issue_frequency': <float>,
  'license': <bool>,
  'repository_size': <int>
}

NOTE: It is important that an environmental variable GITHUB_ACCESS_TOKEN is set up to compute the "issue events frequency".

Current Release

[0.0.1]

Now the scorer takes into account Chef and Puppet files when computing the ratio of iac scripts.

  • Added support for Chef and Puppet.
  • Fixed div-by-zero when computing the ratio of comments.

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.0.1.tar.gz (3.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: repository-scorer-0.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.4

File hashes

Hashes for repository-scorer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ff1b0af1b4c69274bebd73d063e0fc387d5f261a4a382db9c0c1bb9adbbc9327
MD5 72bc76aff18a49b549d03218325f7592
BLAKE2b-256 e9bc6bdf2896816b7e3d7dd2f32c05a96da0761775257497199e1183d4bc4b60

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