Function get_type
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def get_type(self, node):
if isinstance(node, ast.BinOp):
left_type = self.get_type(node.left)
right_type = self.get_type(node.right)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_function_return_type
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_function_return_type(self, function_name, args_type=[]):
function = self.functions[function_name]
if is_system_function(function_name):
return SystemFunction.get_function(function_name).return_type
if function is not None:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function analysis
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def analysis(self):
for node in self.module_node.body:
if isinstance(node, ast.Assign):
self.analysis_assign_node(self.variables, node)
elif isinstance(node, ast.Expr):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function analysis_function
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def analysis_function(self, function_node, args_type=[]):
variables = Variables()
return_type = Type.VOID
for node in function_node.body:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
return self.get_function_return_type(node.func.id, args_type)
Avoid too many return
statements within this function. Open
return self.variables[node.id].var_type
Avoid too many return
statements within this function. Open
return Type.STRING
Avoid too many return
statements within this function. Open
return Type.NUMBER
Avoid too many return
statements within this function. Open
return Type.LIST