Repository navigation
Adding directory coverage thus supporting the Treemap widget - #23
Merged
RadoBuransky merged 7 commits intoOct 25, 2015
Merged
RadoBuransky merged 7 commits into
RadoBuransky merged 7 commits into
Conversation
The stub parser is not used anymore, removed it
Justification: relying on getParentFile gets the path splitting working under windows and unix - adapted the tests to the new behavior - added a windows / unix switch in the tests to get them working on both systems PathUtils now converts: - the empty path to an empty List - an absolute path to a list folders (not including the drive name under windows) - a relative path to a list of folders
Justification:
- sanitizing the reported file pathes to a common format makes the sensor simpler
- it is a precondition for implementing proper directory coverage
- tests run now under unix and windows, easier to develop
The sonar.sources property can be read from the settings. By mapping all
reported pathes (absolute / base dir relative / source dir relative) against
the actual file tree it is possible to converte all of them to the same
source dir relative format.
For instance
/home/src/main/scala/folder/test0.scala => folder/test0.scala
folder/test1.scala => folder/test1.scala
/src/main/scala/test2.scala => test2.scala
...
- testing absolute report file paths - testing base dir relative report file paths - testing source dir relative report file paths
The SonarQube treemap widgets work better if metrics exist for the project, the directory and the file level. Project coverage is defined as sum of ALL children Directory coverage is defined as sum of the DIRECT children The directories have to be treated special because the SonarQube treemap displays all directories on the same level (not as a tree). Using full sums would hide bad coverage results in some cases.
- measures should be saved for all levels (directory, project, module, file) - the sum should not be necessary any more - makes the two metrics more similar, a correct "sum" for the coverage value cannot be defined as easily.
RadoBuransky
added a commit
that referenced
this pull request
Oct 25, 2015
Adding directory coverage thus supporting the Treemap widget
|
Michael, I have version 5.1.3 installed, which includes this PR, but am still not getting Treemap. Do I need to make any config changes so this shows up? Maybe if I could have a look at your sample project, I could see what I'm missing. Thanks, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi again,
thats the 2nd in a series of 3 pull request I tried to separate functionality a bit.
This one is the reason that I actually started to work on the code (-:
I noticed that the Treemap widget is not working correctly with Statementcoverage. Reason is that the directories do not have StatementCoverage values.
The treemap widgets cannot be traveresed from project -> module -> directory -> file if the directory does not provide the same statistics as the other levels. I changed the code to collect data for directories as well.
There are two options
either summing up all values (B) or using only direct children (A):
If all directories with values are represented on one treemap level (as SonarQube does) the result of A is a treemap that shows for each directory the "quality of its children" which I think is correct. If grandchildren would be added (option B) you could easily have a green directory with red files inside (if the sub directories are big enough)...
The Pull Request implements approach A. Hope that fits into the plugin.
Remarks:
but additional tests would surely be a good idea
Best Michael