Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Name

Python Plugin

Latest version

Trunk

Requires Sonar version

2.9 or higher

License

GNU LGPL v3

Developers

Waleri Enns

Issue Tracker

http://jira.codehaus.org/browse/SONARPLUGINS/component/15262

Sources

http://svn.codehaus.org/sonar-plugins/trunk/python

Description / Features

This plugin enables the analysis of Python projects.

Current feature list:

  • Recognition of basic program entities:
    • Directories
    • Python modules
    • Python packages
  • Provides basic size metrics:
    • files (number of)
    • lines
    • lines of comments
    • lines of code
  • Static code checking via pylint (covering as well code style as code defects aspects)
  • Provides cyclomatic complexity metrics including:
    • Complexity per function/method
    • Complexity per module
    • Complexity distributions 
  • Basic highlighting mode for Python in Sonar UI

Dependencies

This plugin has following dependencies:

  • For complexity analysis the Python interpreter is needed, anything >=2.5 will do.
  • Pylint is used for the rules compliance analysis.

Installation

  1. Copy the jar-archive into /extensions/plugins/ directory
  2. 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.language to py and other fields according to the general description
  • Make sure your sonar-server is running
  • run sonar-runner in the directory containing the sonar-project.properties-file

See here for general information about analyzing via sonar-runner.

Roadmap

TODO

Loading
T Key Summary Assignee Reporter P Status Resolution Created Updated Due
New Feature SONARPLUGINS-1639 Support of code duplication detection Waleri Enns Waleri Enns Major Closed Fixed Jan 22, 2012 Feb 28, 2012
Improvement SONARPLUGINS-1635 Rework the recognition of basic program entities Waleri Enns Waleri Enns Major Closed Fixed Jan 22, 2012 Feb 28, 2012
Improvement SONARPLUGINS-1634 Improve the pylint integration Waleri Enns Waleri Enns Major Closed Fixed Jan 22, 2012 Feb 28, 2012
New Feature SONARPLUGINS-1573 Add a colorizer for python code Waleri Enns Waleri Enns Major Closed Fixed Dec 20, 2011 Jan 15, 2012
Improvement SONARPLUGINS-1547 Make the pylint integration configurable Waleri Enns Waleri Enns Major Closed Fixed Dec 07, 2011 Jan 15, 2012

  • No labels