piotrpasich/code-quality-threshold
Composer 安装命令:
composer require piotrpasich/code-quality-threshold
包简介
README 文档
README
This extension is purposed to run every necessary tool to check the code against violation from composer (ex. tools - PHP Mess Detector, PHP Code Sniffer, PHP Dead Code Detector, PHP Copy Paste).
Installation
composer require piotrpasich/code-quality-threshold:dev-master --dev
Configuration
To your composer.json file you might add
"scripts": {
"quality-test": [
"piotrpasich\\CodeQualityThreshold\\Composer\\ScriptHandler::checkThresholds"
]
},
And execute the command
composer quality-test
You can also add this script to already existing scripts like post-update-cmd.
Reports
If the test throws an exception you can always ask for the report:
composer quality-test -v
Advanced configuration
This plugin checks the app folder by default, but you can always change this behavior by creating yml file. This might be placed wherever you want, ex. app/Config/cqt.yml
Then you need to add to your composer.json file the extra option:
"extra": {
"cqt-parameters": {
"file": "app/Config/cqt.yml"
}
}
The example yml file might look like:
phpmd:
class: piotrpasich\CodeQualityThreshold\Tool\Phpmd
options:
threshold: 42
directory: src
rules: Config/Phpmd/ruleset.xml
phpcs:
class: piotrpasich\CodeQualityThreshold\Tool\Phpcs
options:
threshold: 42
rules: Config/Phpcs/ruleset.xml
directory: src
phpcpd:
class: piotrpasich\CodeQualityThreshold\Tool\Phpcpd
options:
threshold: 42
directory: src
Phpdcd:
class: piotrpasich\CodeQualityThreshold\Tool\Phpdcd
options:
directory: src
threshold: 21
Adding new tools
To add new tool you need to specify new record in yml file (look at the Advanced configuration chapter) and create a class extending Tool abstract class from the plugin.
piotrpasich/code-quality-threshold 适用场景与选型建议
piotrpasich/code-quality-threshold 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.93k 次下载、GitHub Stars 达 36, 最近一次更新时间为 2015 年 02 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 piotrpasich/code-quality-threshold 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 piotrpasich/code-quality-threshold 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.93k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 37
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-13