SonarQube for Drupal Projects

北城以北 提交于 2019-12-22 00:28:36

问题


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.

  1. Why SonarQube guys deprecated the old PHP Plugin which is more configurable than the Previous one.
  2. 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.

  1. 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)

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!