-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add line numbers for metrics in Cyclomatic and Halstead operators #218
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #218 +/- ##
==========================================
+ Coverage 95.76% 95.86% +0.09%
==========================================
Files 25 25
Lines 1370 1403 +33
Branches 293 296 +3
==========================================
+ Hits 1312 1345 +33
Misses 33 33
Partials 25 25
☔ View full report in Codecov by Sentry. |
Please update one of the tests to verify this behaviour |
…w lineno and endline entries for Halstead and Cyclomatic.
Thanks for reviewing this! I couldn't find a test that covered similar behavior, so I created on that checks all metric fields and values from the cache. I'm not sure it's in the best place, maybe it'd be better as a separated test file? Writing the test uncovered two issues:
|
As a first step to address #217, allowing wily to generate annotated source listings with inline visualization of code metrics, we need to record line numbers for code blocks when building the cache.
Radon already supplies line numbers (lineno and endline) for Cyclomatic Complexity, so we just record those in the detailed metrics.
For Halstead line numbers, we need to customize visitor, harvester and some other pieces. PRs and issues upstreaming this work have already started being submitted to radon.
This PR is necessary regardless of whether the
annotate
feature lands as a command or is kept as a separate tool.