gocyclo:计算Go源代码中函数的圈复杂度

时间:2021-02-04 14:14:40
【文件属性】:
文件名称:gocyclo:计算Go源代码中函数的圈复杂度
文件大小:14KB
文件格式:ZIP
更新时间:2021-02-04 14:14:40
go golang code-metrics mccabe cyclomatic-complexity Gocyclo Gocyclo计算Go源代码中函数的。 循环复杂度是一种,可用于标识需要重构的代码。 它通过函数的源代码测量线性独立路径的数量。 函数的圈复杂度是根据以下规则计算的: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' 具有较高圈复杂度的功能需要更多的测试用例才能覆盖所有可能的路径,并且可能更难理解。 通过应用导致较小功能的通用重构技术,可以降低复杂性。 安装 要安装gocyclo命令,请运行 $ go get github.com/fzipp/gocy
【文件预览】:
gocyclo-main
----go.mod(41B)
----analyze.go(4KB)
----CONTRIBUTORS(178B)
----stats.go(2KB)
----analyze_test.go(2KB)
----directives.go(770B)
----LICENSE(1KB)
----CHANGELOG.md(1KB)
----stats_test.go(3KB)
----testdata()
--------ignores.go(216B)
--------ifs.go(198B)
--------operators.go(137B)
--------methods.go(154B)
--------directory()
--------cases.go(359B)
--------comms.go(346B)
--------literals.go(147B)
--------loops.go(180B)
----.github()
--------workflows()
----README.md(3KB)
----complexity.go(1KB)
----cmd()
--------gocyclo()

网友评论