This commit is contained in:
Tomas Dvorak
2026-02-22 15:41:27 +01:00
parent 0b88627e54
commit 409acd2e08
84 changed files with 65382 additions and 27475 deletions
+3 -5
View File
@@ -165,7 +165,7 @@ func (a *ControlFlowAnalyzer) calculateCyclomaticComplexity(node ast.Node) int {
complexity := 1
ast.Inspect(node, func(n ast.Node) bool {
switch n.(type) {
switch n := n.(type) {
case *ast.IfStmt:
complexity++
case *ast.ForStmt:
@@ -175,10 +175,8 @@ func (a *ControlFlowAnalyzer) calculateCyclomaticComplexity(node ast.Node) int {
case *ast.CaseClause:
complexity++
case *ast.BinaryExpr:
if e, ok := n.(*ast.BinaryExpr); ok {
if e.Op == token.LAND || e.Op == token.LOR {
complexity++
}
if n.Op == token.LAND || n.Op == token.LOR {
complexity++
}
}
return true
-1
View File
@@ -25,7 +25,6 @@ type BestPractice struct {
type PracticesFetcher struct {
cache map[string][]BestPractice
cacheMu sync.RWMutex
docsPath string
language string
frameworks []string
}