Skip to main content

A Python library for computing various software metrics from the source code

Project description

Metrics is a Python package for computing various software metrics from the source code. This package can compute:

  • raw metrics (various LOC, blank lines, different line averages and line percentages, etc.)

  • Halstead metrics

  • McCabe’s complexity (cyclomatic complexity)

  • Henry-Kafura Information Flow metrics (module complexity)

Usage

Metrics package can be used from command line or programmatically. Here’s a code example of using package API:

import metrics

metrics.foo('source_file.c') # returns a value

A command line usage example is shown below:

$ metrics cc source_file.c
source_file.c
   F 356:0 func1
   F 1093:0 func2

Average complexity: F (724.5)

Detailed documantation for how package can be used is at https://metrics.readthedocs.org/.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Lisence

MIT

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

metrics-felbeaver-0.0.1.tar.gz (12.3 kB view hashes)

Uploaded Source

Built Distribution

metrics_felbeaver-0.0.1-py3-none-any.whl (14.1 kB view hashes)

Uploaded Python 3

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