Showing 542 of 3,395 total issues
Function radioButton
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def radioButton(self, title, name=None, *args, **kwargs):
""" simpleGUI - adds, sets & gets radioButtons all in one go """
widgKind = WIDGET_NAMES.RadioButton
selected = kwargs.pop("selected", False)
callFunction = kwargs.pop("callFunction", True)
- 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 dnd_end
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def dnd_end(self, target, event):
gui.trace("<<DRAGGABLE_WIDGET.dnd_end>> %s target=%s", self.Name, target)
# from somewhere, dropped nowhere - self destruct, or put back
if self.Canvas is 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 _prepareCopyAndPasteMenu
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def _prepareCopyAndPasteMenu(self, event, widget=None):
if self.copyAndPaste.inUse:
if event is not None:
widget = event.widget
self._changeMenuState(self.widgetManager.get(WIDGET_NAMES.Menu, "EDIT"), DISABLED, 'Disabling', 10)
- 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 test_gui_options
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_gui_options():
print("\tTesting gui options")
app.setTitle("New title")
assert app.getTitle() == "New title"
assert app.title == "New title"
Function test_menus
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_menus():
print("\tTesting Menubar")
app.addMenuList("a", LIST_ONE, tester_function)
app.createMenu("MEN2")
Function test_setters
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_setters(widg_type, widg_id, widg_val=None):
print("\tTesting setters")
exec("app.set" + widg_type + "Bg(\""+widg_id +"\", \"red\")")
exec("app.set" + widg_type + "Fg(\""+widg_id +"\", \"red\")")
exec("app.set" + widg_type + "DisabledFg(\""+widg_id +"\", \"red\")")
Function test_properties
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_properties():
print("\tTesting properties")
app.startToggleFrame("PP_frame")
assert isinstance(app.addProperties("tog_p1", HASH_ONE), Properties)
Function hideWidgetType
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def hideWidgetType(self, kind, name, collapse=False):
items = self._getWidgetList(kind, name, limit=False)
for item in items:
if self._widgetHasContainer(kind, item):
- 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 stop
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def stop(self, event=None):
""" Closes the GUI. If a stop function is set, will only close the GUI if True """
theFunc = self._getTopLevel().stopFunction
if theFunc is None or theFunc():
- 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 getEntry
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def getEntry(self, name):
entry = self.widgetManager.get(WIDGET_NAMES.Entry, name)
if entry.showingDefault:
if entry.isNumeric:
return 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 _changeMenuState
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _changeMenuState(self, menu, state, text, limit=None):
# changes the specified menu object's state to the new state, using the specified text for logging
numMenus = menu.index("end")
if numMenus is not None: # MAC_APP (and others?) returns None
for item in range(numMenus+1):
- 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 chunk
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def chunk(self, seek=None, lenient=False):
"""
Read the next PNG chunk from the input file; returns a
(*type*, *data*) tuple. *type* is the chunk's type as a
byte string (all PNG chunk types are 4 bytes long).
- 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 check_palette
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def check_palette(palette):
"""Check a palette argument (to the :class:`Writer` class)
for validity. Returns the palette as a list if okay; raises an
exception otherwise.
"""
- 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 njDecode
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def njDecode(jpeg, size):
njDone()
nj.spos = jpeg
nj.pos = 0
nj.size = size & 0x7FFFFFFF
- 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 addDbTable
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def addDbTable(self, title, value, table, row=None, column=0, colspan=0, rowspan=0,
Function __init__
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, parent, app, defaultLocation="Marlborough, UK", proxyString=None, useTtk=False, font=None):
super(GoogleMap, self).__init__(parent, text="GoogleMaps")
self.alive = True
self.API_KEY = ""
self.parent = parent
Function _configOptionBoxList
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _configOptionBoxList(self, title, options, kind):
""" Tidies up the list provided when an OptionBox is created/changed
:param title: the title for the OptionBox - only used by TickOptionBox to calculate max size
:param options: the list to tidy
- 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 setToolbarDisabled
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def setToolbarDisabled(self, disabled=True):
for but in self.widgetManager.group(WIDGET_NAMES.Toolbar).keys():
if disabled:
self.widgetManager.get(WIDGET_NAMES.Toolbar, but).config(state=DISABLED)
else:
- 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 setUp
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def setUp(self, widget):
self.inUse = True
# store globals
w = widget
wt = gui.GET_WIDGET_CLASS(widget)
- 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 toolbar
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def toolbar(self, names, funcs, **kwargs):
""" simpleGUI - shortener for toolbar """
icons = kwargs.pop('icons', kwargs.pop('findIcon', False))
pinned = kwargs.pop('pinned', None)
disabled = kwargs.pop('disabled', 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"