Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


  1. Register definitions of coding rules, when the server is started.
  2. Optionally define some templates of quality profiles, when the server is started.
  3. Analyze source code and inject results in database 

1. Registering


Coding Rules

This step relates to the extension point org.sonar.api.rules.RuleRepository. A RuleRepository defines a set of coding rules. It usually loads data from a XML file:


Code Block
  <!-- the format used before sonar 2.3 is still supported : attributes key and priority on the node <rule> -->
    <!-- unique key within this repository -->
    <!-- default priority when the rule is activated (optional, default value is MAJOR). Values are INFO, MINOR,

    <!-- this key is used later by the sensor to configure the code analyzer --> 
    <!-- available ISO categories : Reliability, Portability, Maintainability, Efficiency, Usability -->
    <category name="Usability"/>

    This node is optional: default value is SINGLE.
    MULTIPLE: the rule can be activated many times with different parameters and priority.
    SINGLE: the rule can be activated once

    <description><![CDATA[Checks that ...]]></description>
      <description><![CDATA[the required header specified inline. Individual header lines must be separated by the string "\n" (even on platforms with a different line separator)]]></description>

2. Defining


Quality Profiles

This step relates to the extension point org.sonar.api.profiles.ProfileDefinition. Profiles Quality profiles provided by plugins are registered at server startup  and can't be edited by users:Image Removedstartup.

3. Analyzing


Source Code

This step relates to the extension point org.sonar.api.batch.Sensor.