Showing 51 of 341 total issues
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return jsonify(node_key=existing_node.node_key, node_invalid=False)
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return jsonify(node_key=node.node_key, node_invalid=False)
Avoid too many return
statements within this function. Open
return True
Function get_node
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_node(node_id):
node = Node.query.filter_by(id=node_id).first_or_404()
form = UpdateNodeForm(request.form)
if form.validate_on_submit():
- 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 handle_status
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def handle_status(self, data, **kwargs):
if self.fp is None:
return
fp = self.fp
- 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 handle_log_entry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def handle_log_entry(self, entry, node):
""" The actual entrypoint for handling input log entries. """
from doorman.models import Rule
from doorman.rules import RuleMatch
from doorman.utils import extract_results
- 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 local_run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def local_run(self, input):
# If we have a 'column_name', we should use that to extract the value
# from the input's columns. Otherwise, we have a whitelist of what we
# can get from the input.
if self.column_name 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 distributed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def distributed(node_id=None, status=None, page=1):
tasks = DistributedQueryTask.query
if status == 'new':
tasks = tasks.filter_by(status=DistributedQueryTask.NEW)
- 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"