• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

sonar-php: :elephant: SonarPHP: PHP static analyzer for SonarQube & SonarLi ...

原作者: [db:作者] 来自: 网络 收藏 邀请

Code Quality and Security for PHP Build Status

This SonarSource project is a static code analyser for PHP language used as an extension for the SonarQube platform. It will allow you to produce stable and easily supported code by helping you find and correct bugs, vulnerabilities and smells in your code.

Features

Useful links

More documentation

Have question or feedback?

To provide feedback (request a feature, report a bug etc.) use the SonarSource Community Forum. Please do not forget to specify the language (PHP!), plugin version and SonarQube version.

If you have a question on how to use plugin (and the docs don't help you), we also encourage you to use the community forum.

Contributing

Topic in SonarSource Community Forum

To request a new feature, please create a new thread in SonarSource Community Forum. Even if you plan to implement it yourself and submit it back to the community, please start a new thread first to be sure that we can follow up on it.

Pull Request (PR)

To submit a contribution, create a pull request for this repository. Please make sure that you follow our code style and all tests are passing (Travis build is created for each PR).

Custom Rules

If you have an idea for a rule but you are not sure that everyone needs it you can implement a custom rule available only for you.

Testing

To run tests locally follow these instructions.

Build the Project and Run Unit Tests

To build the plugin and run its unit tests, execute this command from the project's root directory (you will need Maven):

mvn clean install

Integration Tests

To run integration tests, you will need to create a properties file like the one shown below, and set its location in an environment variable named ORCHESTRATOR_CONFIG_URL.

# version of SonarQube serversonar.runtimeVersion=7.9orchestrator.updateCenterUrl=http://update.sonarsource.org/update-center-dev.properties

Before running any of integration tests make sure the submodules are checked out:

  git submodule init  git submodule update

Plugin Test

The "Plugin Test" is an additional integration test which verifies plugin features such as metric calculation, coverage etc. To launch it, execute this command from directory its/plugin:

mvn clean install

Ruling Test

The "Ruling Test" is a special integration test which launches the analysis of a large code base, saves the issues created by the plugin in report files, and then compares those results to the set of expected issues (stored as JSON files). To launch ruling test:

cd its/rulingmvn clean install

This test gives you the opportunity to examine the issues created by each rule and make sure they're what you expect. You can inspect new/lost issues checking web-pages mentioned in the logs at the end of analysis:

INFO  - HTML Issues Report generated: /path/to/project/sonar-php/its/sources/src/.sonar/issues-report/issues-report.htmlINFO  - Light HTML Issues Report generated: /path/to/project/sonar-php/its/sources/src/.sonar/issues-report/issues-report-light.html

If everything looks good to you, you can copy the file with the actual issues located at

sonar-php/its/ruling/target/actual/

into the directory with the expected issues

sonar-php/its/ruling/src/test/resources/expected/

License

Copyright 2010-2020 SonarSource.

Licensed under the GNU Lesser General Public License, Version 3.0


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap