Skip to content

Commit 1865886

Browse files
fix after merge
1 parent f18290f commit 1865886

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

aibolit/metrics/cc/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ class CCMetric:
1919
def value(self, ast: AST) -> int:
2020
return sum(
2121
self._method_complexity(ast, node)
22-
for node in ast.get_proxy_nodes(
22+
for node in ast.proxy_nodes(
2323
ASTNodeType.METHOD_DECLARATION, ASTNodeType.CONSTRUCTOR_DECLARATION
2424
)
2525
)
2626

2727
def _method_complexity(self, ast: AST, method: ASTNode) -> int:
28-
method_ast = ast.get_subtree(method)
29-
return 1 + sum(self._node_complexity(ast, node) for node in method_ast.get_proxy_nodes())
28+
method_ast = ast.subtree(method)
29+
return 1 + sum(self._node_complexity(ast, node) for node in method_ast.proxy_nodes())
3030

3131
def _node_complexity(self, ast: AST, node: ASTNode) -> int:
3232
if node.node_type in _SIMPLE_NODES:
@@ -48,10 +48,10 @@ def _for_statement_complexity(self, ast: AST, node: ASTNode) -> int:
4848
def _expression_complexity(self, ast: AST, expression: ASTNode | None) -> int:
4949
if expression is None:
5050
return 0
51-
expression_ast = ast.get_subtree(expression)
51+
expression_ast = ast.subtree(expression)
5252
return sum(
5353
1
54-
for node in expression_ast.get_proxy_nodes(ASTNodeType.BINARY_OPERATION)
54+
for node in expression_ast.proxy_nodes(ASTNodeType.BINARY_OPERATION)
5555
if node.operator in ('&&', '||')
5656
)
5757

0 commit comments

Comments
 (0)