Showing 32 of 39 total issues
Avoid too many return
statements within this function. Open
return data["key"] == key
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return data
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return redirect(request.path)
Avoid too many return
statements within this function. Open
return data["id"] == key
Function _prepare_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _prepare_data(request, inject_data):
data = request.POST.copy()
# Handle lists (such as checkboxes)
data = handle_lists(data)
- 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 update_progress_indicators
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_progress_indicators(self):
index = 0
if self.show_progress_indicators:
for form in self.forms:
if form:
- 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 convert_list_to_tree
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def convert_list_to_tree(items, key="key", value="value", children="children", exclude=None):
return_value = []
for item in items:
node = TreeNode(item[key], item[value])
- 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 nest_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def nest_data(sent_data):
"""
Nests strings into dictionaries eg
{
'site.name': 'SITE1'
- 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"