SonarPHP
Language: PHP
Checks: 100+
Categories: Bug Risk, Clarity, Compatibility, Complexity, Duplication, Performance, Security, Style
SonarLint Version: 2.1
SonarPHP Version: 2.10
SonarPHP and SonarLint are products developed by SonarSource.
SonarLint offers the ability to scan code for issues before checking it in, with minimal configuration.
Enable the Plugin
To enable SonarPHP analysis, add the following to your .codeclimate.yml
configuration file:
plugins:
sonar-php:
enabled: true
More information about the CLI is available in the README here: https://github.com/codeclimate/codeclimate
Configure the Plugin
Tests
Telling where the test classes are, also helps Sonar to use specific rules for those files.
plugins:
sonar-php:
enabled: true
config:
tests_patterns:
- src/test/**
- app/src/test/**
Severity
Setting a minimum severity forces Sonar to not create negligible issues.
Possible values are: info
, minor
, major
(default), critical
, blocker
plugins:
sonar-php:
enabled: true
config:
minimum_severity: critical
Understand the Plugin
For detailed information about SonarPHP, please check out the documentation here:
https://www.sonarsource.com/products/codeanalyzers/sonarphp.html
Updated over 6 years ago