计算各种语言的代码度量
multimetric的Python项目详细描述
计算各种语言的代码度量
目的
这个工具尝试为很多很多计算以下指标 程序设计语言
- 注释到代码百分比
- 圈复杂度
- 哈尔斯特德认为困难
- 哈尔斯特德的努力
- 扇出
- 代码行
- 维修性指标
- 公制,根据pylint
- 根据TIOBE的公制
- 根据Halstead提供的缺陷数量
- 根据Halstead编程所需的时间
- 根据Halstead的体积
这个工具的灵感来源于 metrics
安装
PyPi
简单地跑
pip3 install multimetric
来源
- git克隆此存储库
- cd到<;克隆文件夹>
- 通过运行安装所需的需求 ^{1美元
- 运行python3 setup.py build
使用
^{pr2}$默认情况下,工具根据文件名猜测内容类型,如果 不适合你,请看下面
输出
输出将作为json写入stdout。在
输出结构
- files包含CLI传递的每个文件的列表
- overall包含所有传递文件的计算值
- stats包含所有文件的统计计算值 通过see Statistical additions
项目结构
item | description | ran ge | recommen dation |
---|---|---|---|
comment_ratio | Comment to Code percentage | 0.. 100 | > 30.0 |
cyclomatic_co mplexity | Cyclomatic complexity according to McCabe | 0.. (in f) | < 10 |
fanout_extern al | Number imports from out of tree modules | 0.. (in f) | |
fanout_intern al | Number imports from same source tree modules | 0.. (in f) | |
halstead_bugp rop | Number of delivered bugs according to Halstead | 0.. (in f) | < 0.05 |
halstead_diff iculty | Difficulty according to Halstead | 0.. (in f) | |
halstead_effo rt | Effort according to Halstead | 0.. (in f) | |
halstead_time required | Time required to program according to Halstead | 0.. (in f) | |
halstead_volu me | Volume according to Halstead | 0.. (in f) | |
lang | list of identified programming languages | lis t | |
loc | Lines of code | 1.. (in f) | |
maintainabili ty_index | Maintainability index | 0.. 100 | > 80.0 |
operands_sum | Number of used operands | 1.. (in f) | |
operands_uniq | Number of unique used operands | 1.. (in f) | |
operators_sum | Number of used operators | 1.. (in f) | |
operators_uni q | Number of unique used operators | 1.. (in f) | |
pylint | General quality score according to pylint | 0.. 100 | > 80.0 |
tiobe_compile r | Compiler warnings score according to TIOBE | 0.. 100 | > 90.0 |
tiobe_complex ity | Complexity according to TIOBE | 0.. 100 | > 80.0 |
tiobe_coverag e | Coverage according to TIOBE | 0.. 100 | > 80.0 |
tiobe_duplica tion | Code duplications score according to TIOBE | 0.. 100 | > 80.0 |
tiobe_fanout | Fan-Out score according to TIOBE | 0.. 100 | > 80.0 |
tiobe_functio nal | Functional defect score according to TIOBE | 0.. 100 | > 90.0 |
tiobe_securit y | Security score according to TIOBE | 0.. 100 | > 90.0 |
tiobe_standar d | Language standard score according to TIOBE | 0.. 100 | > 80.0 |
tiobe | General quality score according to TIOBE | 0.. 100 | > 80.0 |
统计
除了上面提到的之外,stats项还包含 以下项目,这些项目本身包含 Item structure
- max=度量的所有项的最大值
- mean=度量的所有项的统计平均值
- median=度量所有项目的统计中值
- min=度量的所有项的最小值
- sd=度量所有项目的标准偏差
进一步阅读
错误和贡献
请随意创建问题或请求
- 项目
标签: