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

Number format in some report #2289

Merged
merged 6 commits into from
Jan 27, 2020
Merged

Number format in some report #2289

merged 6 commits into from
Jan 27, 2020

Conversation

BraisGabin
Copy link
Member

Add thousand separators. Remove useless - and remove space between value and %

This is before:
Captura de pantalla 2020-01-24 a las 22 59 46
and this is after this PR:
Captura de pantalla 2020-01-24 a las 23 04 14

This changes are made for the console output too. If we don't want them I can refactorice them

@codecov-io
Copy link

codecov-io commented Jan 24, 2020

Codecov Report

Merging #2289 into master will increase coverage by 0.01%.
The diff coverage is 95.83%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2289      +/-   ##
============================================
+ Coverage     81.69%   81.71%   +0.01%     
  Complexity     2111     2111              
============================================
  Files           348      348              
  Lines          6038     6039       +1     
  Branches       1105     1105              
============================================
+ Hits           4933     4935       +2     
  Misses          519      519              
+ Partials        586      585       -1
Impacted Files Coverage Δ Complexity Δ
...ch/detekt/cli/console/ComplexityReportGenerator.kt 86.95% <100%> (-1.05%) 5 <0> (ø)
.../arturbosch/detekt/cli/console/ComplexityReport.kt 100% <100%> (ø) 4 <0> (+1) ⬆️
...tlab/arturbosch/detekt/cli/out/HtmlOutputReport.kt 93.1% <83.33%> (+1.16%) 16 <3> (-1) ⬇️

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 ea23edf...d55295e. Read the comment docs.

Copy link
Member

@schalkms schalkms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is fine. I like it, because we align the format of the different reports.

@@ -14,21 +15,19 @@ class ComplexityReportGenerator(private val complexityMetric: ComplexityMetric)
ComplexityReportGenerator(ComplexityMetric(detektion))
}

fun generate(): String? {
fun generate(): List<String>? {
if (cannotGenerate()) return null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty list makes more sense here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this. The null says: there's not report. An empty list sais: there is a report and it's empty. In the html report both are the same but in the console report don't. Because we need to add the header. We could check if the list is empty but I think that it's not that clean.

val complexities = complexityReport.split("\n")
return complexities.subList(1, complexities.size - 1)
}
return ComplexityReportGenerator.create(detektion).generate() ?: emptyList()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If generate() returns an empty list you won't need this conditional statement anymore.
Maybe this method can then be inlined as well.

@BraisGabin BraisGabin requested a review from schalkms January 26, 2020 12:43
@arturbosch arturbosch merged commit 61ecbc0 into detekt:master Jan 27, 2020
@arturbosch arturbosch added this to the 1.5.0 milestone Jan 27, 2020
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.

4 participants