A general purpose tool for validating cyclomatic complexity in Python.
Project description
PyCyclo
py-cyclo is a general-purpose command-line tool for analyzing and validating cyclomatic complexity in Python code. Designed for developers who want to maintain clean, testable, and maintainable code, py-cyclo provides detailed reports and enforcement mechanisms to ensure your codebase doesn't spiral out of control.
🚀 Features
- Measure cyclomatic complexity of Python functions and methods
- Set complexity thresholds and enforce them via CLI
- Supports per-file, per-function, or project-wide analysis
- JSON, plain-text, or colorized output formats
- Integrates easily into CI/CD pipelines
📦 Installation
You can install py-cyclo via pip:
pip install py-cyclo
Or install directly from GitHub:
pip install git+https://github.com/ocrosby/py-cyclo.git
🛠️ Usage
# Execute this from within your project directory
cyclo --max-complexity 10
Example Output
example.py:12 - function `process_data` has cyclomatic complexity of 13 (limit: 10)
Options
| Flag | Description |
|---|---|
--max-complexity |
Set the maximum allowed complexity per function |
--help |
Show CLI help |
🔧 Configuration
At present there are no configuration options.
🧪 Testing
To run the test suite:
pip install --upgrade pip
pip install invoke
pip install ".[dev]"
invoke test
🤝 Contributing
Contributions are welcome! To get started:
- Fork this repo
- Create a new branch (
git checkout -b feature/my-feature) - Make your changes
- Write tests and ensure everything passes
- Submit a pull request
Please follow the Contributor Covenant code of conduct.
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
🙌 Acknowledgments
🔗 Related Projects
📬 Contact
Feel free to reach out via GitHub Issues or submit feature requests and bugs.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_cyclo-1.1.0.tar.gz.
File metadata
- Download URL: py_cyclo-1.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd194e9a45a1c3448d000fd9fa536b7aac66f8e7c54804945da2c21da3a9dc92
|
|
| MD5 |
c7321d010fa2569ed5d3aba27806728f
|
|
| BLAKE2b-256 |
7059ed70ae1e2aff89bcea4739088c2bf553abd6917c8b36e8cf9a4516081949
|
File details
Details for the file py_cyclo-1.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: py_cyclo-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc3fd0281fd4e70e186172fc6e7554ecc3a30f64f90b7cd8d06df35adad6973e
|
|
| MD5 |
6ad7b24680428c74c9d13ccd0d6ae25f
|
|
| BLAKE2b-256 |
775cb3a901f74428476b8c74fff05eda96e7c331b43c571e2b8fd1318e0f06b4
|