Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Sonar
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h1>Extend Coding Rules - Via extensions/rules</h1><p>From version 0.2, its possible <span style="font-size: 10.0pt;line-height: 13.0pt;">to extend the rules available in quality profiles for any tool. To do this a directory matching the tool name and a XML with the description of the rules within this directory should be provided. For example:</span></p><ul><li>[Sonar Server Install Dir]\extensions\rules\cppcheck\rules.xml for the cppcheck sensor</li></ul><h2>Rules XML Format<span style="color: rgb(51,51,51);font-size: 10.0pt;font-weight: normal;line-height: 13.0pt;"> </span></h2><table class="confluenceTable"><tbody><tr><th class="confluenceTh">Xml Description</th><th class="confluenceTh"><p>Example</p></th></tr><tr><td colspan="1" class="confluenceTd"><p><rules> <br /><rule key="RULE_ID"><br /><name><![CDATA[ ... put here the human readable name of this rule ... ]]></name><br /><configKey><![CDATA[RULE_ID@$(EXTERNALSENSORCLASS)]]></configKey><br /><category name=" ... category type ... " /><br /><description><![CDATA[ ... put here the human readable description of this rule ... ]]></description><br /></rule><br /></rules></p></td><td colspan="1" class="confluenceTd"><p><?xml version="1.0" encoding="UTF-8" standalone="yes"?><br /><rules><br /> <rule key="Te0001DataContextCannotBeSet"><br /> <name><![CDATA[Te0001DataContextCannotBeSet]]></name><br /> <configKey><br /> <![CDATA[Te0001DataContextCannotBeSet@PC_LINT]]><br /> </configKey><br /> <category name="Maintainability" /><br /> <description><br /> <![CDATA[ Data Context Should no be set, please use another approach ]]><br /> </description><br /> </rule><br /></rules></p></td></tr><tr><td class="highlight confluenceTd" colspan="1">Attributes</td><td class="highlight confluenceTd" colspan="1">Description</td></tr><tr><td colspan="1" class="confluenceTd">key [RULE_ID]</td><td colspan="1" class="confluenceTd">Id of the rule, <strong>should match the id in the external reports</strong></td></tr><tr><td colspan="1" class="confluenceTd">name</td><td colspan="1" class="confluenceTd">Can be really anything, in the quality profile in sonar its the first name that is displayed per rule</td></tr><tr><td colspan="1" class="confluenceTd">configKey</td><td colspan="1" class="confluenceTd"><span style="color: rgb(0,51,102);">This key is used later by the sensor to configure the code analyzer <span style="color: rgb(0,0,0);">(</span><a href="http://docs.codehaus.org/display/SONAR/Extending+Coding+Rules">Extending+Coding+Rules</a><span style="color: rgb(0,0,0);"> </span><span style="color: rgb(0,0,0);">)</span></span></td></tr><tr><td colspan="1" class="confluenceTd">category name</td><td colspan="1" class="confluenceTd">Can be anything, examples include Maintainability Style Usability etc</td></tr><tr><td colspan="1" class="confluenceTd">description</td><td colspan="1" class="confluenceTd">In the quality profile in sonar ui, the description will be show after expanding each rule</td></tr></tbody></table><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Important" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9SW1wb3J0YW50fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>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</p></td></tr></table>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced