Jones Complexity checker, plugin for flake8
Project description
Flake8 extension to calculate per-line complexity and total code density.
Installation
$ pip install jones-complexity
Usage (Standalone)
$ python -m jones_complexity --min 5 your_file.py
Usage (flake8)
$ flake8 --max-line-complexity 15 --max-jones-score 8 yourproject
What is this?
Because
if user.get_full_name().toUpper().split(' ')[0] == 'ALICE':
return True
is harder to read and maintain than
if first_name == 'Alice':
return True
Shamelessly named after myself, in the tradition of McCabe and Halstead.
Examples
Itself:
$ python jones_complexity.py jones_complexity.py Line counts: { "39": 19, "46": 15, "137": 12, "115": 12, [...] "18": 1, "9": 1, "148": 1 } Jones Score: 4.0
$ p jones_complexity.py pyesprima.py Line counts: { "4182": 265, "3688": 190, "4186": 189, "48": 189, "4181": 164, [...] "1201": 1, "3728": 1 } Jones Score: 9.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jones-complexity-0.1.1.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for jones_complexity-0.1.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24090edccda886ee140a82373b97712f72620866d44c4c573aa40004dfdc4aa0 |
|
MD5 | daec60d77881cc54fdf985b237c0ff22 |
|
BLAKE2b-256 | 3340ac12a23b04b58c45548f373e80c7a666864030a437a87423006cb42a6fb5 |