Showing 542 of 3,395 total issues
Avoid deeply nested control flow statements. Open
for val in self.widgetManager.group(WIDGET_NAMES.TextArea).values():
if str(val) == str(child):
child = val
break
Function setStatusbarBg
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def setStatusbarBg(self, colour, field=None):
if self.hasStatus:
if field is None:
for status in self._statusFields:
status.config(background=colour)
- 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 deeply nested control flow statements. Open
with PauseCallFunction(callFunction, box):
if not box['menu'].invoke(index):
if override:
gui.trace("Setting OptionBox: %s to disabled option: %s", title, index)
box["menu"].entryconfigure(index, state="normal")
Avoid deeply nested control flow statements. Open
if self.splashConfig is not None:
gui.trace("\t\t Updated SPLASH to: %s", val)
self.splashConfig['text'] = val
else:
gui.trace("\t\t No SPLASH to update")
Avoid deeply nested control flow statements. Open
for rb in rbs:
if rb.DEFAULT_TEXT == keys[1]:
rb["text"] = val
break
Avoid deeply nested control flow statements. Open
if loc[0] > -1:
gui.trace("Setting location: %s", loc)
self.setSubWindowLocation(k, *loc)
else:
gui.trace("Skipping location: %s", loc)
Avoid deeply nested control flow statements. Open
if keys[1] not in ["prevButton", "nextButton", "title"]:
self.warn("Invalid PAGEDWINDOW label: %s for PAGEDWINDOW: %s", keys[1], keys[0])
else:
try:
widgets[keys[0]].config(**{keys[1]:val})
Avoid deeply nested control flow statements. Open
if keys[1] not in ["actionHeading", "actionButton", "addButton"]:
self.warn("Invalid GRID label: %s for GRID: %s", keys[1], keys[0])
else:
try:
self.confGrid(keys[0], keys[1], val)
Avoid deeply nested control flow statements. Open
if butCount == 1:
command=lambda row=val, *args: self.action(row)
else:
command=lambda name=text, row=val, *args: self.action(name, row)
Function setStatusbarFg
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def setStatusbarFg(self, colour, field=None):
if self.hasStatus:
if field is None:
for status in self._statusFields:
status.config(foreground=colour)
- 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 deeply nested control flow statements. Open
if self.configParser.has_option(section, k):
data = str(self.configParser.get(section, k))
else:
data = but.DEFAULT_TEXT
Avoid deeply nested control flow statements. Open
if nj.error:
return
sbx += 1
Avoid deeply nested control flow statements. Open
with app3.frame():
app3.label("stacks-2")
with app3.frame():
Avoid deeply nested control flow statements. Open
with app3.page():
app3.addLabel("l3", "label")
with app3.page():
Avoid deeply nested control flow statements. Open
with app3.page():
app3.addLabel("l4", "label")
with app3.tab("t4", afterTab='a', beforeTab='a'):
Function preamble
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def preamble(self, lenient=False):
"""
Extract the image metadata by reading the initial part of
the PNG file up to the start of the ``IDAT`` chunk. All the
chunks that precede the ``IDAT`` chunk are read and either
- 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 iterboxed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def iterboxed(self, rows):
"""Iterator that yields each scanline in boxed row flat pixel
format. `rows` should be an iterator that yields the bytes of
each row in turn.
"""
- 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 deeply nested control flow statements. Open
with app3.frame():
app3.label("stacks-1")
with app3.frame():
Avoid deeply nested control flow statements. Open
if ((marker & 0xF8) != 0xD0):
raise Exception(NJ_SYNTAX_ERROR)
else:
nj.buf = (nj.buf << 8) | marker
nj.bufbits += 8
Avoid deeply nested control flow statements. Open
with app3.frame():
app3.label("stacks-3")