Showing 542 of 3,395 total issues
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
for val in self.widgetManager.group(WIDGET_NAMES.TextArea).values():
if str(val) == str(child):
child = val
break
Avoid deeply nested control flow statements. Open
if len(obj) == 0:
del widgets[name]
try: del self.vars[widgType][name]
except: pass # no var
return True
Function addMenuEdit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def addMenuEdit(self, inMenuBar=False):
self._initMenu()
self.copyAndPaste.inUse = True
# in case we already made the menu - just return
- 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 clearStatusbar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def clearStatusbar(self, field=None):
if self.hasStatus:
if field is None:
for status in self._statusFields:
status.config(text=self._getFormatStatus(""))
- 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 size[0] > 1:
gui.trace("Setting size: %s", size)
tl.geometry("%sx%s" % (size[0], size[1]))
tl.shown = True
else:
Function meter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def meter(self, title, value=None, *args, **kwargs):
""" simpleGUI - adds, sets & gets meters all in one go """
widgKind = WIDGET_NAMES.Meter
kind = kwargs.pop("kind","'meter")
fill = kwargs.pop("fill", 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 replaceRow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def replaceRow(self, rowNum, data):
if 0 > rowNum >= len(self.cells):
raise Exception("Invalid row number.")
else:
dataLen = len(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 _resetAccess
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _resetAccess(self):
if self.accessMade:
self.check("access_label_check", True)
self.check("access_input_check", False)
self.check("access_button_check", False)
- 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 addMarker
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def addMarker(self, location, size=None, colour=None, label=None, replace=False):
""" function to add markers, format:
&markers=color:blue|label:Z|size:tiny|location_string
"""
if size 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
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)
Avoid deeply nested control flow statements. Open
with app3.page():
app3.addLabel("l3", "label")
with app3.page():
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.page():
app3.addLabel("l4", "label")
with app3.tab("t4", afterTab='a', beforeTab='a'):
Function coords
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def coords(self):
# The tip window must be completely outside the master widget;
# otherwise when the mouse enters the tip window we get
# a leave event and it disappears, and then we get an enter
# event and it reappears, and so on forever :-(
- 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 nj.error:
return
sbx += 1
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
Avoid deeply nested control flow statements. Open
with app3.frame():
app3.label("stacks-2")
with app3.frame():
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.panedFrame("vpf1", vertical=True):
app3.addLabel("l2", "label")
with app3.tab("t3", beforeTab='t2'):