Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
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="icon=false|title=Table of Contents" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZXx0aXRsZT1UYWJsZSBvZiBDb250ZW50c30&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3RvY30&locale=en_GB&version=2" data-macro-name="toc"></td></tr></table><h4>I have projects that do not use the required versions of PHPUnit, PHP Depend, etc. What can I do?</h4><p>If you are able to have several versions of code analysis tool on the same machine, just make sure that the correct one will be used.</p><p>You also have to make sure that the output file log is compatible with the one specified by the version of the tool you want to use.</p><p> </p><h4>I have created my own PHP_CodeSniffer Standard or PHPMD ruleset. Can I use it with the Sonar PHP plugin?</h4><p>Yes, but with some extra work. Two possible cases :</p><p>1) Your work consisted in <span style="text-decoration: underline;">pure configuration</span>: modify a ruleset for PHPMD or create a PHPCS Standard including Sniffs from existing standards.</p><p>In this case you'll be able to recreate your work directly from the Sonar UI for <a class="confluence-link" href="/display/SONAR/Quality+Profiles" data-linked-resource-id="114786474" data-linked-resource-type="page" data-linked-resource-default-alias="Quality Profiles" data-base-url="http://docs.codehaus.org">Quality Profiles</a></p><p>You must check for the presence of your rules in Sonar profiles, as some PHPCS rule descriptions are still missing.</p><p>If you don't find all of your rules, you simply fall in case 2.</p><p>2) You <span style="text-decoration: underline;">added code</span> to the solutions: you developed Sniffs or PHP PMD Rules</p><p>In this case you will have to <a class="confluence-link" href="/display/SONAR/Extending+PHP+Coding+Rules" data-linked-resource-id="201719816" data-linked-resource-type="page" data-linked-resource-default-alias="Extending PHP Coding Rules" data-base-url="http://docs.codehaus.org">Extend the PHP Coding Rules</a></p><p> </p><h4>How do I prevent external tools from analyzing some source files?</h4><p>Most of the time, using the <a class="confluence-link" href="/display/SONAR/Analysis+Parameters" data-linked-resource-id="113541435" data-linked-resource-type="page" data-linked-resource-default-alias="Analysis Parameters" data-base-url="http://docs.codehaus.org">sonar.exclusions</a> property will be enough to exclude files from being reported by Sonar. However, there might be some cases where one really wants to exclude files from being analyzed by an external tool (may it be PHP_CodeSniffer, PHPMD or PHP Depend):</p><ul><li>a file is badly written and the tool is crashing when analyzing this file, thus preventing Sonar from completing the analysis</li><li>a big number of files must be excluded and there's no need for the external tools to spend time analyzing files that won't be reported by Sonar</li></ul><p>In these specific cases, you should use the 'sonar.xxxx.argumentLine' property of the external tools to manually add the exclusions you want. For instance, for PHP_CodeSniffer, you would add the following property:</p><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>sonar.phpCodesniffer.argumentLine=--ignore=Database/* # on Linux, would be --ignore=Database\* on Windows</pre></td></tr></table><p>This would tell PHP_CodeSniffer to ignore every PHP file located in the "Database" folder.</p><table class="wysiwyg-macro" data-macro-name="note" data-macro-parameters="title=Be carefull!" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vdGU6dGl0bGU9QmUgY2FyZWZ1bGwhfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>When specifying exclusions directly for each tool, you should also consider to set the 'sonar.exclusions' property accordingly. Otherwise, you may have files with incomplete analysis.</p></td></tr></table><p> </p><h4>How do I disable unit test & coverage reporting?</h4><p>The easiest way to disable unit test reporting is to use the following standard Sonar property:</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>sonar.dynamicAnalysis=false</pre></td></tr></table><p>If you want to disable only unit test reporting or coverage reporting, you can use the following properties instead:</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>sonar.phpUnit.skip=true sonar.phpUnit.coverage.skip=true</pre></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