Question

I'm working on a Sonar project and I have to make a plugin in order to get metrics and to compute them.

In order to understand how it works, I'd like to try to do the following examples:

  • Get the value (complexity) and to compute it as a double or a float value.
  • Take the complexity value (MetricsCore.COMPLEXITY) and if it's more than 200, write a message to say that it's too complex.
  • Take the number of comments lines and multiply it by 10.

I know that in these examples what I want to do is useless, but it's just to understand how to get the Metrics Core value and take their value, and to create new Metrics. I don't find a lot of documentation....

Thank you very much

For information, I will use Sonar-reference-plugin.

Was it helpful?

Solution

You can find our sample plugins here: https://github.com/SonarSource/sonar-examples/tree/master/plugins. "sonar-reference-plugin" should give you lots of information.

This should help you to better understand how things work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top