Whole file
rubik/radon
The author described this change as “fix(visitor): do not undercount a class' complexity”. It counts as a record because the check below fails on the code as it stood at 4c95e0ac3 and passes on 1981e2e87, with nothing else changed between the two runs.
Projectrubik/radon
Fix saved2019-01-26
Sharing licenceMIT · LICENSE
Change size+2 −1
What the code was meant to do, written into the code itself as a save note
fix(visitor): do not undercount a class' complexity
The change
| 272 | 272 | visitor.visit(child) | |
| 273 | 273 | methods.extend(visitor.functions) | |
| 274 | 274 | body_complexity += (visitor.complexity + | |
| 275 | - | visitor.functions_complexity) | |
| 275 | + | visitor.functions_complexity + | |
| 276 | + | len(visitor.functions)) | |
| 276 | 277 | visitors_max_lines.append(visitor.max_line) | |
| 277 | 278 | inner_classes.extend(visitor.classes) | |
| 278 | 279 |
The check that tells the two apart
fail→pass·radon/tests/test_complexity_visitor.py::test_visitor_classes[\n
Check file radon/tests/test_complexity_visitor.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it4c95e0ac386351adcaab62eee55bffeaf60e1371
Broken version dated2019-01-26
Moduleradon.visitors
Units changedComplexityVisitor
Fingerprint99ea59353fb05bcc
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.