You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ PYTHONPATH=lib:$PYTHONPATH python3 -m cohesion -h
usage: __main__.py [-h] [-v | -x] (-f FILES [FILES ...] | -d DIRECTORY)
[-b BELOW | -a ABOVE]
...
-b BELOW, --below BELOW
only show results with this percentage or lower
-a ABOVE, --above ABOVE
only show results with this percentage or higher
Further, there's even tests confirming this behavior: test_module.test_module_filter_above_equal and test_module.test_module_filter_below_equal.
My rationale behind this decision was that there will often be classes that sit on the boundary of common fraction's percentages (e.g. 1/2 -> 50%, 1/4 -> 25%, 1/10 -> 10%). Further, if you're really curious about classes with cohesion below 25%, then there's probably many classes sitting at exactly25% that you're also curious about.
On toy files like the example it's not as obvious why this would be helpful, but in larger code bases with many classes and a large variation in cohesion percentages it can be helpful.
After updating to
0.9.1
I have faced a new issue:example.py
file from the readmecohesion -f example.py
, output will be:cohesion --below 100 -f example.py
, output will not changeHowever,
100
is not below100
. It is equal.Just for the reference, running
cohesion --below 99 -f example.py
:It works well.
The text was updated successfully, but these errors were encountered: