Showing 112 of 407 total issues
Function diff_objects
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def diff_objects(old_instance, new_instance, fields):
"""
Diff two objects by examining the given fields and
return a string.
"""
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update(case_id, values):
"""
.. function:: RPC TestCase.update(case_id, values)
Update the fields of the selected test case.
- 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 HttpResponseRedirect(request.META.get("HTTP_REFERER", "/"))
Function add_link
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_link(values, update_tracker=False, **kwargs):
"""
.. function:: RPC TestExecution.add_link(values)
Add new URL link to a TestExecution
- 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_case_notification_recipients
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_case_notification_recipients(case):
recipients = set()
if case.emailing.auto_to_case_author:
recipients.add(case.author.email)
- 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_fieldsets
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_fieldsets(self, request, obj=None):
# adding new account b/c we have permissions
if not obj and self.has_add_permission(request):
return super().get_fieldsets(request, obj)
- 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 drawPercentBar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function drawPercentBar (testExecutions, updateTestRun = false) {
let positiveCount = 0
let negativeCount = 0
const allCount = testExecutions.length
const statusCount = {}
- 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_install_requires
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_install_requires(path):
requires = []
links = []
with open(path, "r", encoding="utf-8") as file:
- 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 request_host_link
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def request_host_link(request, domain_name=None):
protocol = "https://"
if "runserver" in sys.argv:
protocol = "http://"
- 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 updateBuildSelectFromVersion
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function updateBuildSelectFromVersion (keepFirst) {
const updateCallback = function (data) {
updateSelect(data, '#id_build', 'id', 'name', 'version__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 open
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def open(self):
for rootpath, _dirs, files in os.walk(self.project_root, topdown=False):
for file_name in files:
if file_name.endswith((".html", ".txt")):
self.all_template_files.add(
- 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 dumps_result
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dumps_result(self, result: JsonResult) -> str:
if isinstance(result, JsonSuccessResult):
if isinstance(result.data, str):
result.data = html.escape(result.data)
elif isinstance(result.data, timedelta):
- 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"