问题
Currently i am using SonarQube with latest version 5.0 .
I am using SonarQube for scanning PHP projects with PHP plugin.
Now there some queries which i having regarding SonarQube and PHP Plugin.
- Why SonarQube guys deprecated the old PHP Plugin which is more configurable than the Previous one.
- Is it possible to Analyze Drupal Projects with SonarQube.
Thanks in advance for the answers.
回答1:
After doing so much research for SonarQube Coding Standards i came to following conclusion.
please find below my comments for the questions that i asked previously.
Because of some security reasons, SonarQube guys modified the plugin and removed the configuration part from PHP plugin. However, the configuration part is till present for JAVA(SonarQube version 5.0)
Yes, We can scan Drupal projects with SonarQube. This is possible after SonarQube version 5.1 where they have provided a separate Quality profile for Drupal Projects. set that profile as default while analyzing.
Also you have to used file suffixes within your project properties file.
sonar.php.file.suffixes= file extensions that you have to scan
Default extensions scanned by PHP Plugins are php,php3,php4,php5,phtml,inc
As Drupal Contains files with extension such as .moudle and .install. To enable Sonar to analyze these files, you have to add the same in above mentioned key.
You can also enable this using Dashboard where you can globally set the same properties within PHP plugin.
There is one more alternative, if you don't want to use Sonar. I am using Coder(Static code analysis tool for Drupal) and integrating the same with Jenkins. Through ANT/Phing i am triggering the static code analysis and generate various reports and displayed in Jenkins Dashboard.
来源:https://stackoverflow.com/questions/28675553/sonarqube-for-drupal-projects