mozilla / rust-code-analysis

Library to analyze and collect metrics on source code
https://mozilla.github.io/rust-code-analysis/
262 stars 46 forks source link

Refactor command line format enumerator #1045

Closed Luni-4 closed 1 year ago

Luni-4 commented 1 year ago

This PR refactors the command line format enumerator splitting up the code in functions which are more comprehensible at first glance and reduces useless references passage. It leaves the main functionalities untouched.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.23 :warning:

Comparison is base (46273e1) 74.26% compared to head (2a9bf79) 74.03%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1045 +/- ## ========================================== - Coverage 74.26% 74.03% -0.23% ========================================== Files 65 65 Lines 15932 15982 +50 ========================================== + Hits 11832 11833 +1 - Misses 4100 4149 +49 ``` | [Impacted Files](https://app.codecov.io/gh/mozilla/rust-code-analysis/pull/1045?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mozilla) | Coverage Δ | | |---|---|---| | [rust-code-analysis-cli/src/formats.rs](https://app.codecov.io/gh/mozilla/rust-code-analysis/pull/1045?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mozilla#diff-cnVzdC1jb2RlLWFuYWx5c2lzLWNsaS9zcmMvZm9ybWF0cy5ycw==) | `0.00% <0.00%> (ø)` | | | [rust-code-analysis-cli/src/main.rs](https://app.codecov.io/gh/mozilla/rust-code-analysis/pull/1045?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mozilla#diff-cnVzdC1jb2RlLWFuYWx5c2lzLWNsaS9zcmMvbWFpbi5ycw==) | `0.45% <0.00%> (-0.01%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/mozilla/rust-code-analysis/pull/1045/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mozilla)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Luni-4 commented 1 year ago

@marco-c

I refactored the code a bit using traits to make the code clearer and easier to maintain. I tried locally and there are no regressions for what I can see