This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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

PyEsprima:

$ 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
Release History

Release History

This version
History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jones_complexity-0.1.2-py2-none-any.whl (5.8 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Feb 17, 2016
jones-complexity-0.1.2.tar.gz (3.7 kB) Copy SHA256 Checksum SHA256 Source Feb 17, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting