lizard
lizard copied to clipboard
Add "--short" option, print in warnings in red or green
-
Add "--short" option prints only warnings and total summary.
-
Print warnings string:
- red (threshold exceeded) -
!!!! Warnings (cyclomatic_complexity > 15 or length > 1000 or nloc > 1000000 or parameter_count > 100) !!!!(problematic functions are not printed in red) - green (no threshold exceeded) -
No thresholds exceeded (cyclomatic_complexity > 15 or length > 1000 or nloc > 1000000 or parameter_count > 100)
Missing "--short" option tests
Hi @bzgec thanks for the pull request and sorry for the late response. Do you have test for "--short" option now?
Are tests from 02da78e enough?
Hi @bzgec thanks for the test. I have some comments on the test and solution. Some of them are preventive unless my assumptions are wrong.
- I think it's an improvement to split
print_and_save_modulesintosave_modulesandsave_modules. Butsave_modulesseems to be a method that is blocking, rather than continuous yielding. The behaviour of lizard will be very different after this change. - Since the change is mainly adding one if, having one new test is ok. However,
assertNotEqualis something I will try my best to avoid. It's too easy to pass and too hard to fail, especially when you are asserting a very specific thing. I find the project so far has 0 assertNotEqual.