Showing 542 of 3,395 total issues
Function addMenuCheckBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def addMenuCheckBox(self, menu, name, func=None, shortcut=None, underline=-1):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, parent, text, props=None, haveLabel=True, *args, **options):
Function map
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def map(self, title, value=None, *args, **kwargs):
""" simpleGUI - adds, sets & gets maps all in one go """
widgKind = WIDGET_NAMES.Map
zoom = kwargs.pop("zoom", None)
size = kwargs.pop("size", 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 label
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def label(self, title, value=None, *args, **kwargs):
""" simpleGUI - adds, sets & gets labels all in one go """
widgKind = WIDGET_NAMES.Label
kind = kwargs.pop("kind", "standard").lower().strip()
- 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 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.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
for tick in ticks:
self.widgetManager.get(WIDGET_NAMES.TickOptionBox, title, group=WidgetManager.VARS)[tick].set(ticks[tick].get())
else:
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
Function _addTooltip
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _addTooltip(self, item, text, hideWarn=False):
self._loadTooltip()
if not ToolTip:
if not hideWarn:
self.warn("ToolTips unavailable - check tooltip.py is in the lib folder")
- 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 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})
Function setStatusbarWidth
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def setStatusbarWidth(self, width, field=None):
if self.hasStatus:
if field is None:
for status in self._statusFields:
status.config(width=width)
- 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 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 self.horizontalButtons:
but.grid(row=0, column=row, sticky=N+E+S+W, pady=1)
widg.grid_columnconfigure(row, weight=1)
else:
but.grid(column=0, row=row, sticky=N+E+S+W, pady=1)
Function set
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set(self, value=[0,0], text=None):
if value is None:
value=[0,0]
if not hasattr(value, "__iter__"):
raise Exception("DualMeter.set() requires a list of two arguments")
- 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 gui.GET_PLATFORM() in [gui.MAC, gui.LINUX]:
but.config(highlightbackground=widg.cget("bg"))
if self.horizontalButtons:
Function setStatusbar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def setStatusbar(self, text, field=0):
if self.hasStatus:
if field is None:
for status in self._statusFields:
status.config(text=self._getFormatStatus(text))
- 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 datePicker
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def datePicker(self, title, value=None, *args, **kwargs):
""" simpleGUI - adds, sets & gets datePickers all in one go """
widgKind = WIDGET_NAMES.DatePicker
change = kwargs.pop("change", None)
toValue = kwargs.pop("toValue", 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 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)