爱意满满的作品展示区。
xcatliu

检查代码质量的工具 cqc v0.4.0 发布,支持 vue 文件的检查了

  •  
  •   xcatliu ·
    xcatliu · Oct 9, 2017 · 3935 views
    This topic created in 3164 days ago, the information mentioned may be changed or developed.

    先贴上 GitHub 地址: https://github.com/xcatliu/cqc


    简单介绍

    cqc ( Code Quality Checker )是一个代码质量检查工具,可以通过运行一个脚本来获取项目的源代码行数,代码重复率和圈复杂度。目前支持的文件类型有 js, jsx, vue, css, less, scss, sass, styl

    功能

    • 支持检查源代码行数,代码重复率和圈复杂度
    • 简单易用,运行一个脚本即可
    • 同时也提供了大量选项,可以很方便的查看详细内容或更改配置项
    • 提供了API,可以集成到 git hook 或 ci 中

    示例

    # 安装
    npm install -g cqc
    # 检查所有 js 和 jsx 文件
    cqc src/**/*.js src/**/*.jsx
    # 输出结果
    Output:
    
    Number of files:        10
    Source lines of code:   647
    Duplicate rate:         3.46%
    High complexity rate:   0.00%
    Max complexity:         10
    

    更新内容

    应广大 v 友的需求,现在已经支持 vue 文件的检查啦!

    前帖

    6 replies    2020-06-05 16:55:21 +08:00
    imherer
        1
    imherer  
       Oct 9, 2017
    消灭 0 回复
    xiaoluoboding
        2
    xiaoluoboding  
       Oct 9, 2017
    消灭 1 回复
    huntzhan
        3
    huntzhan  
       Oct 9, 2017
    不仅仅是 duplicated code,我觉得检测 dead code 也是很有价值的。
    不过感觉 dead code 的识别很难做......
    yuanxing008
        4
    yuanxing008  
       Oct 11, 2017
    php 还不支持吧。。
    zyg
        5
    zyg  
       Jun 5, 2020
    支持 react 和 ts 吗?
    xcatliu
        6
    xcatliu  
    OP
       Jun 5, 2020
    很久没更新了,支持 react,不支持 ts
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3938 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 00:50 · PVG 08:50 · LAX 17:50 · JFK 20:50
    ♥ Do have faith in what you're doing.