Showing 120 of 158 total issues
Function connect_nodes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def connect_nodes(nodes):
"""Connect the nodes in a list linearly."""
for n, next_node in zip(nodes, nodes[1:]):
if isinstance(n, ControlFlowNode):
_connect_control_flow_node(n, next_node)
- 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 IgnoredNode()
Avoid too many return
statements within this function. Open
return self.add_module(
Avoid too many return
statements within this function. Open
return self.append_node(AssignmentNode(
Avoid too many return
statements within this function. Open
return self.assign_multi_target(node, rhs_visitor.result)
Avoid too many return
statements within this function. Open
return VulnerabilityType.SANITISED, interactive
Avoid too many return
statements within this function. Open
return VulnerabilityType.UNKNOWN, interactive
Avoid too many return
statements within this function. Open
return self.assignment_call_node(label.result, node)
Avoid too many return
statements within this function. Open
return VulnerabilityType.TRUE, interactive
Avoid too many return
statements within this function. Open
return self.add_blackbox_or_builtin_call(node, blackbox=False)
Avoid too many return
statements within this function. Open
return IgnoredNode()
Function restore_saved_local_scope
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def restore_saved_local_scope(
self,
saved_variables,
args_mapping,
line_number
- 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 is_flask_route_function
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def is_flask_route_function(ast_node):
"""Check whether function uses a route decorator."""
for decorator in ast_node.decorator_list:
if isinstance(decorator, ast.Call):
if _get_last_of_iterable(get_call_names(decorator.func)) == 'route':
- 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 return_connection_handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def return_connection_handler(nodes, exit_node):
"""Connect all return statements to the Exit node."""
for function_body_node in nodes:
if isinstance(function_body_node, ConnectToExitNode):
if exit_node not in function_body_node.outgoing:
- 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 save_local_scope
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_local_scope(
self,
line_number,
saved_function_call_index
):
- 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_names
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_names(node, result):
"""Recursively finds all names."""
if isinstance(node, ast.Name):
return node.id + result
elif isinstance(node, ast.Subscript):
- 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 report
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def report(
vulnerabilities,
fileobj,
print_sanitised,
):
- 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 find_vulnerabilities_in_cfg
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_vulnerabilities_in_cfg(
cfg,
definitions,
lattice,
blackbox_mapping,
- 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 visit_Call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def visit_Call(self, node):
if node.args:
for arg in node.args:
self.visit(arg)
if node.keywords:
- 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 fixpoint_runner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fixpoint_runner(self):
"""Work list algorithm that runs the fixpoint algorithm."""
q = self.cfg.nodes
while q != []:
- 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"