Versions Compared

Key

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

Once rules have been added to extensions/rules, they should be enabled in the relevant quality profile in Sonar. Only after this has been done, the analysis can be performed

Extend Coding Rules - Via extensions/rules

...

Xml Description

Example

<rules>
<rule key="RULE_ID">
<name><![CDATA[ ... put here the human readable name of this rule ... ]]></name>
<configKey><![CDATA[RULE_ID@$(EXTERNALSENSORCLASS)]]></configKey>
<category name=" ... category type ... " />
<description><![CDATA[ ... put here the human readable description of this rule ... ]]></description>
</rule>
</rules>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rules>
<rule key="Te0001DataContextCannotBeSet">
<name><![CDATA[Te0001DataContextCannotBeSet]]></name>
<configKey>
<![CDATA[Te0001DataContextCannotBeSet@PC_LINT]]>
</configKey>
<category name="Maintainability" />
<description>
<![CDATA[ Data Context Should no be set, please use another approach ]]>
</description>
</rule>
</rules>

AttributesDescription
key [RULE_ID]Id of the rule, should match the id in the external reports
nameCan be really anything, in the quality profile in sonar its the first name that is displayed per rule
configKeyThis key is used later by the sensor to configure the code analyzer (Extending+Coding+Rules )
category nameCan be anything, examples include Maintainability Style Usability etc
descriptionIn the quality profile in sonar ui, the description will be show after expanding each rule

...

Info

 

titleImportant

Once rules have been added to extensions/rules, they should be enabled in the relevant quality profile in Sonar. Only after this has been done, the analysis can be performed