diff --git a/rule/cognitive-complexity.go b/rule/cognitive-complexity.go index 3dc09d9..318276c 100644 --- a/rule/cognitive-complexity.go +++ b/rule/cognitive-complexity.go @@ -148,17 +148,14 @@ type binExprComplexityCalculator struct { func (v *binExprComplexityCalculator) Visit(n ast.Node) ast.Visitor { switch n := n.(type) { - case *ast.UnaryExpr: - // TODO (chavacava): confirm if NOT should be taken into account - if n.Op == token.NOT { - v.complexity++ - } case *ast.BinaryExpr: isLogicOp := n.Op == token.LAND || n.Op == token.LOR if isLogicOp && n.Op != v.currentOp { v.complexity++ v.currentOp = n.Op } + case *ast.ParenExpr: + v.complexity++ } return v