I'm on a project working with SonarQube and the given analysis. Can anyone tell me if I can add an own metric which SonarQube uses to analyse my code? For example (I know this one already exists "Comments Balance"):
Tharmar's Metric 00 = "Commented Lines of Code" / "Lines of Code" - OR -
Tharmar's Metric 01 = Count the word "Tharmar" used in "Lines of Code"
I tried to find something usefull in the documentation. But the only thing I found was about Manual Measures. I was able to create a new column within the analysis. (proved with the csv-plugin) Understandably, it contains no data.
Is there a way how I can tell SonarQube how to find that data? Or how to calculate that Metric with the given data.
Thanks for any help :)
Manual measure won't answer your need: they are only used to push "simple" data at project level.
What you need to do is to write your own SonarQube plugin to compute your own metrics. Here's the material that will be useful to you: