【发布时间】:2013-02-19 23:10:17
【问题描述】:
我正在尝试 Sonar,但我在 php 项目中遇到了一些问题。
我必须做多模块才能得到至少 php 和 js 的分析。
这是我的 sonar-project.properties:
sonar.projectKey=xxxx sonar.projectName=xxxx sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8
sonar.sources=
sonar.language=php
sonar.exclusions=htdocs/libraries/externals/**
sonar.phpCodesniffer.skip=true
sonar.modules=php-module,js-module
# PHP module
php-module.sonar.projectName=PHP Module
php-module.sonar.language=php
php-module.sonar.sources=
php-module.sonar.projectBaseDir=htdocs
php-module.sonar.exclusions=libraries/externals/**
# JavaScript module
js-module.sonar.projectName=JavaScript Module
js-module.sonar.language=js
js-module.sonar.sources=js
js-module.sonar.projectBaseDir=htdocs
但是当我运行 sonar-runner 时,我得到了这个错误:
Exception in thread "main" org.sonar.runner.RunnerException: org.sonar.api.utils.SonarException: PHPMD execution failed with returned code '1'. Please check the documentation of PHPMD to know more about this failure
PHPMD 错误是
The parser has reached an invalid state near line "32" in file "/var/www/vhosts/dev3.xxxx.local/htdocs/libraries/externals/AvaTax4PHP/classes/ATConfig.class.php". Please check the following conditions: The keyword "parent" was used as type hint but the class "ATConfig" does not declare a parent.
但是如果我排除了项目和模块中的目录库,为什么会发生这种情况?
我必须向 PHPMD 指定另一个排除列表吗?
【问题讨论】:
标签: php static sonarqube analysis phpmd