flake8-deep-calls
flake8-deep-calls is a Flake8 plugin aimed at reducing complexity in Python code by enforcing the Object Calisthenics rule to "Limit Nesting to One Level." This plugin identifies functions that call other functions in a nested manner, going beyond one level deep, which may indicate overly complex code structures.
Installation
To install flake8-deep-calls, you can use pip:
pip install flake8-deep-calls
Usage
Once installed, the plugin will automatically be included when you run Flake8. To analyze your project, simply use:
flake8 your_project_directory
The plugin will flag functions with excessive call depth, helping you recognize areas where the code could be refactored to reduce complexity.
Configuration
flake8-deep-calls works out-of-the-box with the default settings of Flake8. There are no additional configuration options needed specifically for this plugin as it leverages existing Flake8 configurations.
Rules Enforced
- FDC100: Indicates functions that call other local functions more than one level deep.
Each violation specifies the function name and the depth of calls, guiding developers to consider flattening their function interactions or refactoring into simpler, more decoupled functions.
Motivation
The motivation behind this plugin is to help developers adhere to clean code principles that facilitate easier maintenance, testing, and understanding of the code. By limiting the depth of nested function calls, the code remains straightforward and more aligned with the Single Responsibility Principle.
Contributing
Contributions to improve flake8-deep-calls are welcome! If you have suggestions for improvements, bug reports, or new features, please feel free to contribute to the project by opening issues or submitting pull requests on our GitHub repository.
License
flake8-deep-calls is open-sourced software licensed under the MIT License. See the LICENSE file for more details.
Metadata
Release files for flake8-deep-calls 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flake8_deep_calls-0.1.0.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flake8_deep_calls-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.2 kB
Release files / flake8_deep_calls-0.1.0.tar.gz
| Download URL | flake8_deep_calls-0.1.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fbb1b2eff8e7850ea23cb833d5c42b850ea8c3bb9eddc25bdfcb9900e80ccf60
|
|
BLAKE2b-256 checksum How to use checksums |
695d1c22f14b3146d1e7b3d2ab022cf80475e54b38bbd8c369f762c13e7251a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / flake8_deep_calls-0.1.0-py3-none-any.whl
| Download URL | flake8_deep_calls-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0ab1f9be82cfd2eb3bb2a9bc06010dc99a7538efe0bd5cb371b17813d0b6f2c
|
|
BLAKE2b-256 checksum How to use checksums |
5d9535e1a1b56576844ecea12d92a7ce1412b77e2587cad9f5945f0ce3958b24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|