Features

Sonar PHP Plugin adds PHP language analysis to Sonar. The plugin provides all Sonar builtin features for PHP projects analyis. And it relies on well known analysis tools for PHP projects : PHP Unit, PHP Depend, PHPMD, PHPCPD and PHP_CodeSniffer to provide some additionnal metrics and to detect violations.

Sonar PHP Plugin

PHP Unit

phpcpd

PHP Depend

PHPMD

PHP_CodeSniffer

SQLI CodeSniffer

0.2

3.4.12

0.9.12

0.2.5

0.4.0

0.3

3.5.5

1.3.1

0.9.14

0.2.5

1.3.0RC1

Version 0.2 relies on SQLI_CodeSniffer which is derived from PHP_CodeSniffer but incompatible with the original tool.

Installation

This installation section provides two way for installing necessary tools to make the plugin work correctly. If you are familiar with PHP environnement, you may just need to reed the "Short way" section, if you need more help, you can follow the more verbose installation guide.

Short way for PHP experts

Install PHP runtime with the corresponding xdebug extensions. Version 5.2.6 or newer is required.

Known limitations

This is an alpha version so we expect it to have a lot of bugs/uncovered cases. Please report all bugs you find on Jira.

Metrics in this version are only collected by PHP_Depend, this implies that files containing unstructured code (not OO) will not be included in this kind of analysis.
It is known that copy/paste detection is wrongly extended to comments (see #218).
The actual CodeSniffer standard used by default is just a demo one.
You can include other standards with their configuration files the "SQLI_CodeSniffer way".
We suggest you to wait for the 1.3.0 release of PHP_CodeSniffer that will bring extended configuration capabilities and will be rapidly integrated with the plugins.

Changelog

com.atlassian.confluence.macro.MacroExecutionException: JIRA project does not exist or you do not have permission to view it.