← Back

McCabe

PythonMcCabePEP20
Published:


McCabe

McCabe is a tool to check the cyclomatic complexity of your Python code. It calculates the complexity of your code by counting the number of linearly independent paths through the code. The higher the complexity, the harder it is to understand and maintain the code.

Installing McCabe

You can install McCabe using pip:

pip install mccabe
# or
conda install mccabe

Checking Cyclomatic Complexity

You can check the cyclomatic complexity of your Python code using McCabe by running the following command:

python3 -m mccabe your_file.py