Skip to content

McCabe Complexity #264

@cowlicks

Description

@cowlicks

This issue on another project puts it better than I can:

McCabe complexity is a number that represents the number of different way one can traverse through a method. It is recommended that this measure never exceeds 10. Running a complexity checker on openspending results in 10 methods with too high complexity (current version). These should all be fixed to keep the code clean and maintainable.

To see the errors I would recommend installing flake8 (can run McCabe's complexity checker and more), navigating to the root of the repo and running:

flake8 --max-complexity=10 --select=C distarray

the output is:

distarray/externals/six.py:559:1: C901 'print_' is too complex (22)
distarray/local/localarray.py:1601:1: C901 'LocalArrayBinaryOperation.__call__' is too complex (10)
distarray/plotting/plotting.py:68:1: C901 'plot_array_distribution' is too complex (15)

The six stuff isn't our problem. But the other functions definitely look too complex.

This is low priority but I thought it was interesting. This might be a good issue for someone to tackle if they want to become acquainted with the codebase.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions