The python radon extension shows the complexity and rating of a class, method or function inline of the source code.
You need to install python-radon at a minimum version 5.1:
pip install "radon>=5.1"
See the radon documentation to understand the rating and complextity values presented by the extension.
MI score | Rank | Maintainability |
---|---|---|
100 - 20 | A | Very high |
19 - 10 | B | Medium |
9 - 0 | C | Extremely low |
CC score | Rank | Risk |
---|---|---|
1 - 5 | A | low - simple block |
6 - 10 | B | low - well structured and stable block |
11 - 20 | C | moderate - slightly complex block |
21 - 30 | D | more than moderate - more complex block |
31 - 40 | E | high - complex block, alarming |
41+ | F | very high - error-prone, unstable block |
The cyclomatic complexity is shown in front of functions, methods or classes. You can also see the current maintainable index of the source code of the active editor in the status bar.
This extension contributes the following settings:
python.radon.enable
: enable/disable this extensionpython.radon.executable
: set to a path to your radon executable, e.g./usr/bin/radon
If you install python-radon on a windows system there is no single radon executable. To solve this you can create a batch script radon.cmd
in a folder which is part of your PATH environment variable of the following content:
@python -m radon %*
Complex icons created by Flat Icons - Flaticon
Provide trouble shooting for Windows System
Spelling errors were corrected
Added screenshot of the functionality to the README.md
Show the maintainability index of the current source code in the status bar
Allow editing settings when executable couldn't be found and the documentation was extended
Added the complexity icon Complex icons created by Flat Icons - Flaticon
Initial release of Python radon