codemetrix
1.0.0
为了真正了解代码库,您需要知道如何松动或耦合,以及它的倾向。
CodeMetrix使计算“耦合指标”的奇怪
在Wikipedia上阅读有关此信息的更多信息。
从指标来看,这是ArchFit的外观。

它还可以帮助您获得项目中代码总线路的每个指导忽略,目录将所有项目代码库,汇总指标(传统/传递耦合等)所占据的百分比,还选择了包含其中大部分这些详细信息的目录。
{
"results" : [
{
"directoryPath" : " /src/application/services " ,
"afferent" : 2 ,
"efferent" : 21 ,
"abstractions" : 0 ,
"concretions" : 1 ,
"loc" : 260 ,
"percent" : 8.51
},
{
"directoryPath" : " /src/application/utils " ,
"afferent" : 3 ,
"efferent" : 2 ,
"abstractions" : 0 ,
"concretions" : 2 ,
"loc" : 52 ,
"percent" : 1.7
},
{
"directoryPath" : " /src/domain/fitness-functions " ,
"afferent" : 14 ,
"efferent" : 79 ,
"abstractions" : 7 ,
"concretions" : 23 ,
"loc" : 1181 ,
"percent" : 38.63
},
{
"directoryPath" : " /src/domain/services " ,
"afferent" : 2 ,
"efferent" : 28 ,
"abstractions" : 0 ,
"concretions" : 2 ,
"loc" : 275 ,
"percent" : 9
},
{
"directoryPath" : " /src/errors " ,
"afferent" : 9 ,
"efferent" : 0 ,
"abstractions" : 0 ,
"concretions" : 0 ,
"loc" : 109 ,
"percent" : 3.57
},
{
"directoryPath" : " /src " ,
"afferent" : 0 ,
"efferent" : 5 ,
"abstractions" : 0 ,
"concretions" : 2 ,
"loc" : 86 ,
"percent" : 2.81
},
{
"directoryPath" : " /src/infrastructure/aws " ,
"afferent" : 20 ,
"efferent" : 28 ,
"abstractions" : 0 ,
"concretions" : 15 ,
"loc" : 684 ,
"percent" : 22.37
},
{
"directoryPath" : " /src/infrastructure/utils/io " ,
"afferent" : 3 ,
"efferent" : 7 ,
"abstractions" : 0 ,
"concretions" : 3 ,
"loc" : 40 ,
"percent" : 1.31
},
{
"directoryPath" : " /src/infrastructure/utils/math " ,
"afferent" : 12 ,
"efferent" : 0 ,
"abstractions" : 0 ,
"concretions" : 3 ,
"loc" : 27 ,
"percent" : 0.88
},
{
"directoryPath" : " /src/infrastructure/utils/string " ,
"afferent" : 22 ,
"efferent" : 0 ,
"abstractions" : 0 ,
"concretions" : 2 ,
"loc" : 25 ,
"percent" : 0.82
},
{
"directoryPath" : " /src/infrastructure/utils/time " ,
"afferent" : 10 ,
"efferent" : 2 ,
"abstractions" : 0 ,
"concretions" : 9 ,
"loc" : 83 ,
"percent" : 2.72
},
{
"directoryPath" : " /src/interfaces " ,
"afferent" : 56 ,
"efferent" : 16 ,
"abstractions" : 12 ,
"concretions" : 0 ,
"loc" : 235 ,
"percent" : 7.69
}
],
"totalLinesOfCode" : 3057 ,
"loc" : " /src/domain/fitness-functions " ,
"afferent" : " /src/interfaces " ,
"efferent" : " /src/domain/fitness-functions " ,
"abstractions" : " /src/interfaces " ,
"concretions" : " /src/domain/fitness-functions "
}CodeMetrix完全无依赖性,非常轻巧。也没有远程呼叫或任何发生的事情,只有普通的旧静态文件分析。
还请注意,当前的实现完全专注于打字稿,但也不可能扩展到支持其他语言。成为我的客人,如果您想更广泛的语言支持,请提出拉动请求!
CodeMetrix假设您已经安装了节点,理想情况下是一个较新版本。
要构建和测试代码,您将需要节点19或以后。
您可以下载编译的文件, dist/index.mjs和codemetrix.sh ,并按照以下说明进行操作。如果您不在Git上,这很好。
但是,更好的选择是克隆此回购并使用install.sh脚本。
它将:
.codemetrix的根级目录codemetrix.sh和dist/index.mjs到新目录codemetrix )向您的.zshrc添加一行如果不匹配您希望设置的方式,请随意修改安装脚本或以自己的方式进行操作。
您需要源或重新加载IDE才能激活更改。
在git存储库中运行codemetrix 。它将假设源代码在src目录中。
要为其提供另一个目录,请运行codemetrix YOUR_DIRECTORY 。
MD有一个专用的贡献,但通常我很乐意为新功能提出建议和建议!