计算各种语言的代码度量

multimetric的Python项目详细描述


Build statusPyPI versionPython versionDownloadsLanguage grade: 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

项目结构

itemdescriptionran gerecommen dation
comment_ratioComment to Code percentage0.. 100> 30.0
cyclomatic_co mplexityCyclomatic complexity according to McCabe0.. (in f)< 10
fanout_extern alNumber imports from out of tree modules0.. (in f)
fanout_intern alNumber imports from same source tree modules0.. (in f)
halstead_bugp ropNumber of delivered bugs according to Halstead0.. (in f)< 0.05
halstead_diff icultyDifficulty according to Halstead0.. (in f)
halstead_effo rtEffort according to Halstead0.. (in f)
halstead_time requiredTime required to program according to Halstead0.. (in f)
halstead_volu meVolume according to Halstead0.. (in f)
langlist of identified programming languageslis t
locLines of code1.. (in f)
maintainabili ty_indexMaintainability index0.. 100> 80.0
operands_sumNumber of used operands1.. (in f)
operands_uniqNumber of unique used operands1.. (in f)
operators_sumNumber of used operators1.. (in f)
operators_uni qNumber of unique used operators1.. (in f)
pylintGeneral quality score according to pylint0.. 100> 80.0
tiobe_compile rCompiler warnings score according to TIOBE0.. 100> 90.0
tiobe_complex ityComplexity according to TIOBE0.. 100> 80.0
tiobe_coverag eCoverage according to TIOBE0.. 100> 80.0
tiobe_duplica tionCode duplications score according to TIOBE0.. 100> 80.0
tiobe_fanoutFan-Out score according to TIOBE0.. 100> 80.0
tiobe_functio nalFunctional defect score according to TIOBE0.. 100> 90.0
tiobe_securit ySecurity score according to TIOBE0.. 100> 90.0
tiobe_standar dLanguage standard score according to TIOBE0.. 100> 80.0
tiobeGeneral quality score according to TIOBE0.. 100> 80.0

统计

除了上面提到的之外,stats项还包含 以下项目,这些项目本身包含 Item structure

  • max=度量的所有项的最大值
  • mean=度量的所有项的统计平均值
  • median=度量所有项目的统计中值
  • min=度量的所有项的最小值
  • sd=度量所有项目的标准偏差

进一步阅读

错误和贡献

请随意创建问题或请求

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
windows请帮助获取java。运行程序时发生lang.nullpointerexception   JPA标准中的错误:java。lang.IllegalArgumentException:此JPQLquery中没有名为“:inputMsgId_1_”的参数   java调度一个小程序,从ScheduledExecutorService开始   java点击AVD“创建设备”按钮抛出NullPointerException   缓存Java9WebStart会多次加载jar文件   使用java计算最小二乘   当代理关闭时,java kafka生产者不会抛出异常   我们什么时候以及为什么要在java中进行自定义序列化?   java使用GSON解析包含包含所需字符串的对象的对象数组   java如何使用BOBJ REST API实现分页?   java身份验证失败:用户的凭据已过期。CAS v4。2.   合并排序中的java无限循环?   java jackson xml将pojo子元素转换为字符串   tcp Java ObjectOutputStream重置错误   如何调用。bat文件,并使用java中的ProcessBuilder发送字符串   奇怪的Java数学结果   java如何在Android中禁用最近的活动按钮?   java刷下应用程序崩溃   使用Java收集所有VersionOne资产及其所有属性   Java打印:创建具有最小可接受边距的页面格式