Skip to main content

pybuilder-radon

GitHub Workflow Status coverage vulnerabilities PyPI version python

A pybuilder plugin that checks the cyclomatic complexity of your project using radon. For more information about radon refer to the radon pypi page.

To add this plugin into your pybuilder project, add the following line near the top of your build.py:

use_plugin('pypi:pybuilder_radon')

NOTE if you are using Pybuilder version v0.11.x, then specify the following version of the plugin:

use_plugin('pypi:pybuilder_radon', '~=0.1.2')

cyclomatic complexity

Cyclomatic complexity is a software metric used to indicate the complexity of a program. It is a quantitative measure of the number of linearly independent paths through a program's source code. Cyclomatic complexity can be used to measure code complexity. The higher the complexity score the more complex the code, which typically translates to the code being more difficult to understand, maintain and to test. The number of the Cyclomatic complexity depends on how many different execution paths or control flow of your code can execute depending on various inputs. The metrics for Cyclomatic Complexity are:

Score Complexity Risk Type
1 to 10 simple not much risk
11 to 20 complex low risk
21 to 50 too complex medium risk, attention
more than 50 very complex unable to test, high risk

Refer to cyclomatic complexity for more information.

Pybuilder radon properties

The pybuilder task pyb radon will use radon to to analyze your project and display the average cyclomatic complexity, verbose mode will display complexity of all classes, functions and methods analyzed. The following plugin properties are available to further configure the plugin's execution.

Name Type Default Value Description
radon_break_build_average_complexity_threshold float None Fail build if overall average complexity is greater than the specified threshold
radon_break_build_complexity_threshold float None Fail build if complexity of any class, function or method exceeds the specified threshold

The plugin properties are set using project.set_property, for example setting the following properties, pyb complexity will fail if the average overall complexity score of the project exceeds 4 or if the complexity score of any class, method or function exceeds 10:

project.set_property('radon_break_build_average_complexity_threshold', 4)
project.set_property('radon_break_build_complexity_threshold', 10)

Development

Clone the repository and ensure the latest version of Docker is installed on your development server.

Build the Docker image:

docker image build \
-t pybradon:latest .

Run the Docker container:

docker container run \
--rm \
-it \
-v $PWD:/code \
pybradon:latest \
bash

Execute the build:

pyb -X

Metadata

Release files for pybuilder-radon 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybuilder-radon 0.3.3
File Size Uploaded Provenance
pybuilder-radon-0.3.3.tar.gz 4.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pybuilder-radon 0.3.3
File Interpreter ABI Platform
pybuilder_radon-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 kB

Release files / pybuilder-radon-0.3.3.tar.gz

Download URL pybuilder-radon-0.3.3.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
352d8cd189b65c28857a196dc68c7077c7f8571a8c67e1c3618803cb531bb8e4
BLAKE2b-256 checksum
How to use checksums
d5c2e7a588dd96dad3211ee062e138296a5173b35c970018df31c2f50e14ad81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / pybuilder_radon-0.3.3-py3-none-any.whl

Download URL pybuilder_radon-0.3.3-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14e2a3d6fa0a91545de7c54c3f10ecc86599bef6c38f79b82b2e076762277827
BLAKE2b-256 checksum
How to use checksums
7dae3b80c694b33f51efcb6d49d2b78762aae6b41fd9c36570320a66ca322690
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Security for pybuilder-radon 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page