Name | Python Plugin |
Latest version | Trunk |
Requires Sonar version | 2.7 or higher |
License | GNU LGPL v3 |
Developers | |
Issue Tracker | http://jira.codehaus.org/browse/SONARPLUGINS/component/15262 |
Sources |
Description / Features
This plugin enables the analysis of Python projects.
The following metrics are supported:
- Lines
- Lines of code
- Comment lines
- Functions
- Cyclomatic complexity, distributions
Dependencies
This plugin has the following dependencies:
- For complexity analysis the Python interpreter is needed, anything >=2.5 will do (TODO: check this)
- Pylint is used for the rules compliance analysis.
Installation
- Copy the jar-archive into /extensions/plugins/ directory
- Restart the Sonar web server
Usage
You can analyze your projects using the usual means (see this page for all available). Just make sure to set a couple of properties. See below how to do it for maven and sonar-runner.
Analyzing with maven
Add your source directories to the build and the language-property to the properties section of your pom, syntax:
<sourceDirectory>src</sourceDirectory>
<sonar.language>py</sonar.language>
- Make sure sonar-server is running
Start the analysis with
mvn sonar:sonar
See here for general information about analyzing via maven.
Analyzing with sonar-runner
- Add a
sonar-project.properties-file to the root directory of your project - Set
sonar.languagetopyand other fields according to the general description - Make sure your sonar-server is running
- run
sonar-runnerin the directory containing thesonar-project.properties-file
See here for general information about analyzing via sonar-runner.
Roadmap
TODO

