mirror of
https://github.com/Dvorinka/Devour.git
synced 2026-06-03 20:13:03 +00:00
updage
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -25,7 +25,6 @@ type BestPractice struct {
|
||||
type PracticesFetcher struct {
|
||||
cache map[string][]BestPractice
|
||||
cacheMu sync.RWMutex
|
||||
docsPath string
|
||||
language string
|
||||
frameworks []string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user