-
Notifications
You must be signed in to change notification settings - Fork 49
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 min and max implementation for Cyclomatic #699
Conversation
67d631e
to
cd64237
Compare
It would be nice (if it's possible) to add some references (papers, websites, ...) which could help to explain why min/max of cyclomatic is interesting. If they don't exist or if they aren't interesting, it isn't a problem, it's more out of curiosity (and I make some archeology on github I always appreciate to have some documentation (even if I don't do it myself all the time ;))). |
Codecov Report
@@ Coverage Diff @@
## master #699 +/- ##
==========================================
+ Coverage 37.16% 37.52% +0.36%
==========================================
Files 50 50
Lines 6294 6348 +54
Branches 936 940 +4
==========================================
+ Hits 2339 2382 +43
- Misses 3311 3318 +7
- Partials 644 648 +4
Continue to review full report at Codecov.
|
cde25d8
to
ee1d966
Compare
ee1d966
to
9b11d67
Compare
I have done the following changes: Added a new field called cyclomatic_sum that stores the sum of all cyclomatic for each space merged, similar to the old usage of cyclomatic. Now this value is used as sum and it is also used for calculate average. This field is merged when the merge funciton is called. Now cyclomatic only stores the cyclomatic value of the single space/method, it doesn't get modified by the merge. This value is used when computing min and max and it is added to the sum when the parsing of the space is completed (implemented in the compute_minmax function of cyclomatic). This changes have been done because when we merge 2 states, the first one could still be uncompleted and so the min and max cannot be computed correctly, now the min and max are only computed when a state has been completed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for doing that.
This PR adds minimum and maximum value for the Cyclomatic metric, adding some new unit testing to handle some corner cases and partly resolving Issue #410 .