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有一個專用的貢獻,但通常我很樂意為新功能提出建議和建議!