Skip to content

Commit 03e78f9

Browse files
committed
roll back method _binary_expression_npath
1 parent c552f2b commit 03e78f9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

aibolit/metrics/npath/main.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,8 @@ def _for_loop_npath(self, node: ASTNode) -> int:
143143
return body_npath + condition_npath
144144

145145
def _binary_expression_npath(self, node: ASTNode) -> int:
146+
if node.operator not in {'&&', '||'}:
147+
return 1
146148
left_npath = self._node_npath(node.operandl)
147149
right_npath = self._node_npath(node.operandr)
148-
if node.operator in {'&&', '||'}:
149-
return left_npath + right_npath
150-
else:
151-
return 1
150+
return left_npath + right_npath

0 commit comments

Comments
 (0)