Sonar - Python plugin rules, what tools it uses behind?

1.3k Views Asked by At

I am setting sonar to analyze a python module and I came up with a doubt about the metrics it generates, maybe a Sonar team member could help me to understand. What tools and 3rd parties tools Sonar uses to calculate the static analysis in Python plugin? I mean, for example for java I know that Sonar rules are a pool of metrics such as Findbugs, checkstyle, PMD, etc, so, for python, what does it use? Does it use pylint, flake8, radon, other? Or does it use a pool of own Sonar rules? Based on which experience?

Thanks a lot for the help. I need to know this, because I am proposing to start using Sonar for static and test metrics in our team.

Ragards.

1

There are 1 best solutions below

0
On

Some custom rules are implemented in Java, just take a look at GitHub.

As you supposed, they also use Pylint to analyse files.

By default the Python Plugin will execute for you the pylint command (the path to this command can be tuned using sonar.python.pylint property)

You can prepare Pylint report to analyse on your own.

Another interesting thing is code coverage:

The Python Plugin does not generate its own test coverage report, but re-uses the one generated by the Coverage Tool or Nose.

Other things like complexity are handled and calculated by their java code.