Skip to content
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

Change Halstead implementation #224

Merged

Conversation

Luni-4
Copy link
Collaborator

@Luni-4 Luni-4 commented Jun 25, 2020

In this way CodeMetrics is independent from lifetimes.

Thanks in advance for your review! :)

@Luni-4 Luni-4 requested a review from calixteman June 25, 2020 14:07
@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2020

Codecov Report

Merging #224 into master will increase coverage by 0.52%.
The diff coverage is 68.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #224      +/-   ##
==========================================
+ Coverage   16.76%   17.28%   +0.52%     
==========================================
  Files          46       46              
  Lines        5899     5918      +19     
  Branches      698      698              
==========================================
+ Hits          989     1023      +34     
+ Misses       4515     4493      -22     
- Partials      395      402       +7     
Impacted Files Coverage Δ
src/metrics/cyclomatic.rs 43.85% <0.00%> (ø)
src/metrics/exit.rs 44.68% <0.00%> (ø)
src/metrics/fn_args.rs 71.42% <0.00%> (ø)
src/metrics/halstead.rs 38.88% <69.23%> (+7.38%) ⬆️
src/spaces.rs 59.18% <70.00%> (-1.11%) ⬇️
src/metrics/loc.rs 46.66% <100.00%> (ø)
src/metrics/mi.rs 60.00% <100.00%> (-4.71%) ⬇️
src/metrics/nom.rs 46.05% <100.00%> (ø)
rust-code-analysis-cli/src/web/server.rs 56.77% <0.00%> (+6.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdf283d...fdcfd13. Read the comment docs.

@Luni-4 Luni-4 force-pushed the halstead-new-implementation branch from 45fb0f5 to 2386cb8 Compare June 25, 2020 14:53
@calixteman
Copy link
Collaborator

Could you make a PR with the tests only and then we can see if the refactoring doesn't introduce any regression ?

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Jun 25, 2020

Could you make a PR with the tests only and then we can see if the refactoring doesn't introduce any regression ?

Yep, good idea, thanks! :)

src/metrics/halstead.rs Outdated Show resolved Hide resolved
src/metrics/halstead.rs Outdated Show resolved Hide resolved
src/metrics/halstead.rs Outdated Show resolved Hide resolved
@calixteman
Copy link
Collaborator

Please rebase.

@Luni-4 Luni-4 force-pushed the halstead-new-implementation branch from a8375d2 to f42e470 Compare July 2, 2020 11:39
@Luni-4 Luni-4 requested a review from calixteman July 2, 2020 11:39
@Luni-4
Copy link
Collaborator Author

Luni-4 commented Jul 2, 2020

The new finalize approach breaks the tests, it seems the Halstead is no more computed in the right way.

@Luni-4 Luni-4 force-pushed the halstead-new-implementation branch from f42e470 to a877bcf Compare July 2, 2020 22:47
@Luni-4
Copy link
Collaborator Author

Luni-4 commented Jul 3, 2020

Now it works, I forgot to update the Mi implementation and stacks :P

@Luni-4
Copy link
Collaborator Author

Luni-4 commented Jul 22, 2020

@calixteman

Can we merge this PR, please?

@Luni-4 Luni-4 force-pushed the halstead-new-implementation branch from a877bcf to fdcfd13 Compare August 4, 2020 08:58
@Luni-4 Luni-4 mentioned this pull request Aug 4, 2020
@calixteman calixteman merged commit 967304c into mozilla:master Aug 4, 2020
@Luni-4 Luni-4 deleted the halstead-new-implementation branch August 4, 2020 10:59
spacedragon pushed a commit to spacedragon/rust-code-analysis that referenced this pull request Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants