McCabe Complexity
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Run flake8 --max-complexity=10 --select=C distarray from the repository root and inspect distarray/local/localarray.py:1601 and distarray/plotting/plotting.py:68. Exclude distarray/externals/six.py; the work is done when the two project functions no longer exceed the chosen complexity threshold and the checker output is verified.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 5
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from enthought/distarray
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 30/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
All issues in enthought/distarray
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100