SonarQube用于Drupal项目 [英] SonarQube for Drupal Projects

查看:83
本文介绍了SonarQube用于Drupal项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前我正在使用SonarQube的最新版本5.0。

Currently i am using SonarQube with latest version 5.0 .

我正在使用SonarQube来扫描带有PHP插件的PHP项目。

I am using SonarQube for scanning PHP projects with PHP plugin.

现在我对SonarQube和PHP插件有一些疑问。

Now there some queries which i having regarding SonarQube and PHP Plugin.


  1. 为什么SonarQube家伙不赞成使用旧的PHP插件,

  2. 是否可以使用SonarQube分析Drupal项目。



Thanks in advance for the answers.

推荐答案

在对SonarQube编码标准进行了大量研究之后,我得出了以下结论。

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. 由于一些安全原因,SonarQube伙计们修改了插件,并从PHP插件中删除了配置部分。但是,JAVA(SonarQube 5.0版)的配置部分一直存在。

  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)

是的,我们可以使用SonarQube扫描Drupal项目。在SonarQube 5.1版之后,这是可能的,因为他们为Drupal项目提供了单独的质量配置文件。

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

PHP插件扫描的默认扩展名是 php,php3,php4,php5,phtml,inc
As Drupal包含扩展名为.moudle和.install的文件。为了使Sonar能够分析这些文件,您必须在上述密钥中添加相同的文件。

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.

您还可以使用Dashboard启用它,在其中可以全局设置相同的属性PHP插件。

You can also enable this using Dashboard where you can globally set the same properties within PHP plugin.

如果您不想使用Sonar,还有另一种选择。
我正在使用Coder(Drupal的静态代码分析工具),并将其与Jenkins集成。通过ANT / Phing,我触发了静态代码分析并生成了各种报告,并显示在Jenkins仪表板中。

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.

这篇关于SonarQube用于Drupal项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆