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

Show the finding count in the html report #2288

Merged
merged 4 commits into from
Jan 27, 2020

Conversation

BraisGabin
Copy link
Member

@BraisGabin BraisGabin commented Jan 24, 2020

This PR adds the finding count like this:

Fixes #2286

@codecov-io
Copy link

codecov-io commented Jan 24, 2020

Codecov Report

Merging #2288 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2288      +/-   ##
============================================
- Coverage     81.69%   81.69%   -0.01%     
  Complexity     2111     2111              
============================================
  Files           348      348              
  Lines          6038     6043       +5     
  Branches       1105     1105              
============================================
+ Hits           4933     4937       +4     
  Misses          519      519              
- Partials        586      587       +1
Impacted Files Coverage Δ Complexity Δ
...tlab/arturbosch/detekt/cli/out/HtmlOutputReport.kt 92.53% <100%> (+0.6%) 17 <1> (ø) ⬇️
.../kotlin/io/gitlab/arturbosch/detekt/api/Context.kt 43.75% <0%> (-6.25%) 0% <0%> (ø)

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

Comment on lines 148 to 177
private fun finding(issue: Issue, entity: Entity, message: String = entity.signature) = CodeSmell(
issue = issue,
entity = entity,
message = message
)

private fun entity(
file: String,
position: Pair<Int, Int>,
text: IntRange = 0..0,
ktElement: KtElement? = null
) = Entity(
name = "",
className = "",
signature = UUID.randomUUID().toString(),
location = Location(
source = SourceLocation(position.first, position.second),
text = TextLocation(text.first, text.last),
locationString = "",
file = file
),
ktElement = ktElement
)

private fun issue(id: String) = Issue(
id = id,
severity = Severity.CodeSmell,
description = "Description $id",
debt = Debt.TWENTY_MINS
)
Copy link
Member

Choose a reason for hiding this comment

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

For better readability I'd rename this to createIssue and so on.
Moving this into a separate file would also be a good idea in order to not clutter this test.

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'll check if this functions could be helpful outside this test. If we can reuse them I agree that they should live outside this file. If they are not useful in other test I'd keep them here as private functions. The main reason is not polute the scope.

OK about the rename.

@BraisGabin BraisGabin mentioned this pull request Jan 26, 2020
@arturbosch arturbosch added this to the 1.5.0 milestone Jan 27, 2020
Copy link
Member

@arturbosch arturbosch left a comment

Choose a reason for hiding this comment

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

Nice improvement :)

@arturbosch arturbosch merged commit 0bb2616 into detekt:master 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.

Show issue count in the html report
4 participants