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
<table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Critical" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9Q3JpdGljYWx9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body">The cxx plugin does not run any static analysis tools, thus all reports must be generated externally</td></tr></table><p>Here is a quick guide how to generate the reports using external tools</p><h1>cppcheck</h1><p>Make sure to pass all include directories as otherwise the analysis will be incomplete. Caveat: cppcheck writes the output to the standard error.</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=bash" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9YmFzaH0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>cppcheck -v --enable=all --xml -I<include directory> <sources> 2> report.xml</pre></td></tr></table><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Rule Extensions" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9UnVsZSBFeHRlbnNpb25zfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>Extension of cppcheck rules is possible by using [sonar instal dir]/<strong>extensions/rules/cppcheck</strong>. See <a class="confluence-link" href="/pages/viewpage.action?pageId=230398146" data-linked-resource-id="230398146" data-linked-resource-type="page" data-linked-resource-default-alias="Extending Rules in C++ Analysers" data-base-url="http://docs.codehaus.org">Extending Rules in C++ Analysers</a> on how to create the rules </p></td></tr></table><h2>Updated Rules</h2><table class="confluenceTable"><tbody><tr><th class="confluenceTh">Version</th><th class="confluenceTh">Rules</th></tr><tr><td colspan="1" class="confluenceTd">1.58</td><td colspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);"><rule> </span><br /><span style="color: rgb(0,0,0);"> <key>redundantCopy</key> </span><br /><span style="color: rgb(0,0,0);"> <configkey>redundantCopy</configkey> </span><br /><span style="color: rgb(0,0,0);"> <name>Buffer 'var' is being written before its old content has been used</name> </span><br /><span style="color: rgb(0,0,0);"> <description> </span><br /><span style="color: rgb(0,0,0);"> Buffer 'var' is being written before its old content has been used. </span><br /><span style="color: rgb(0,0,0);"> </description> </span><br /><span style="color: rgb(0,0,0);"></rule></span></td></tr></tbody></table><p> </p><h1>Valgrind</h1><p>Just tell valgrind to generate XML output. The 'tool' option isn't necessary as 'memcheck' is the default one. Make sure the binaries contain debug info.</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>valgrind --xml=yes --xml-file=report.xml <program> <arguments> </pre></td></tr></table><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Rule Extensions" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9UnVsZSBFeHRlbnNpb25zfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>Extension of valgrind rules is possible by using <span>[sonar instal dir]/</span><strong>extensions/rules/valgrind</strong>. See <a class="confluence-link" href="/pages/viewpage.action?pageId=230398146" data-linked-resource-id="230398146" data-linked-resource-type="page" data-linked-resource-default-alias="Extending Rules in C++ Analysers" data-base-url="http://docs.codehaus.org">Extending Rules in C++ Analysers</a> on how to create the rules </p></td></tr></table><h1>Vera++</h1><p>The generation of vera++ reports is somewhat more tricky. We find all the files we want to be analysed, pipe this list into vera++ and pipe its output into a Perl script which finally generates the required XML. </p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>find <path> -regex ".*\.cc\|.*\.hh" | vera++ - -showrules -nodup |& vera++Report2checkstyleReport.perl > report.xml</pre></td></tr></table><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Rule Extensions" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9UnVsZSBFeHRlbnNpb25zfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>Extension of vera++ rules is possible by using <span>[sonar instal dir]/</span><strong>extensions/rules/vera++</strong>. See <a class="confluence-link" href="/pages/viewpage.action?pageId=230398146" data-linked-resource-id="230398146" data-linked-resource-type="page" data-linked-resource-default-alias="Extending Rules in C++ Analysers" data-base-url="http://docs.codehaus.org">Extending Rules in C++ Analysers</a> on how to create the rules</p></td></tr></table><h1>RATS</h1><p> </p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>rats -w 3 --xml <sources> > report.xml</pre></td></tr></table><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Rule Extensions" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9UnVsZSBFeHRlbnNpb25zfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>Extension of rats rules is possible by using <span>[sonar instal dir]/</span><strong>extensions/rules/rats</strong>. See <a class="confluence-link" href="/pages/viewpage.action?pageId=230398146" data-linked-resource-id="230398146" data-linked-resource-type="page" data-linked-resource-default-alias="Extending Rules in C++ Analysers" data-base-url="http://docs.codehaus.org">Extending Rules in C++ Analysers</a> on how to create the rules</p></td></tr></table><p><span style="font-size: 1.8em;"><br /></span></p><h1>Pc-Lint</h1><p>Please refer to product page (<a href="http://www.gimpel.com/html/pcl.htm">Official Site</a>)</p><table class="wysiwyg-macro" data-macro-name="info" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm99&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>Rules for this tool are disabled by default, so they need to be enabled in the relevant quality profile before they can be imported into sonar</p></td></tr></table><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Rule Extensions" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9UnVsZSBFeHRlbnNpb25zfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>Extension of pclint rules is possible by using <span>[sonar instal dir]/</span><strong>extensions/rules/pclint</strong>. See <a class="confluence-link" href="/pages/viewpage.action?pageId=230398146" data-linked-resource-id="230398146" data-linked-resource-type="page" data-linked-resource-default-alias="Extending Rules in C++ Analysers" data-base-url="http://docs.codehaus.org">Extending Rules in C++ Analysers</a> on how to create the rules </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