Showing 542 of 3,395 total issues
Function addToolbar
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def addToolbar(self, names, funcs, findIcon=False, **kwargs):
# hide the toolbarMin bar
if self.tb.toolbarMin is not None:
self.tb.toolbarMin.pack_forget()
# make sure the toolbar is showing
- 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 deleteRow
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def deleteRow(self, position, pauseUpdate=False, callFunction=False):
if 0 > position >= len(self.cells):
raise Exception("Invalid row number.")
else:
# forget the specified row & button
- 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 go
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def go(self, language=None, startWindow=None):
""" Most important function! starts the GUI """
# check if we have a command line language
if self._language 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
Function logMessage
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def logMessage(msg, level, *args):
""" allows user to log a message - provide a message and a log level
any %s tags in the message will be replaced by the relevant positional *args """
frames = inspect.stack()
# try to ensure we only log extras if we're called from above functions
- 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 menu
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def menu(self, menu, name=None, func=None, **kwargs):
# kind: menu, sub, button, sep, check/tick, radio
kind = kwargs.pop('kind', 'button')
group = kwargs.pop('group', None)
shortcut = kwargs.pop('shortcut', 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 _makeAccess
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def _makeAccess(self):
if not self.accessMade:
def _close(): self.hideSubWindow("access_access_subwindow")
def _changeFg(): self.label("access_fg_colBox", bg=self.colourBox(self.getLabelBg("access_fg_colBox")))
def _changeBg(): self.label("access_bg_colBox", bg=self.colourBox(self.getLabelBg("access_bg_colBox")))
- 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 njDecodeDHT
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def njDecodeDHT():
counts = [0] * 16
njDecodeLength()
while (nj.length >= 17):
i = nj.spos[nj.pos]
- 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_lists
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_lists():
print("\tTesting lists")
assert isinstance(app.addListBox("l1", LIST_ONE), Listbox)
app.addListBox("l2", LIST_TWO)
Function _configWidget
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def _configWidget(self, title, kind, **kwargs):
widget = self.widgetManager.get(kind, title)
# remove any unwanted keys
for key in ["row", "column", "colspan", "rowspan", "label", "name"]:
kwargs.pop(key, 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 addColumn
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def addColumn(self, columnNumber, data, callFunction=False):
if columnNumber < 0 or columnNumber > self.numColumns:
raise Exception("Invalid column number.")
else:
self._hideEntryBoxes()
- 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 _updateEntryDefault
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def _updateEntryDefault(self, name, mode=None):
var = self.widgetManager.get(WIDGET_NAMES.Entry, name, group=WidgetManager.VARS)
entry = self.widgetManager.get(WIDGET_NAMES.Entry, name)
# ignore this if no default to apply
- 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 njDecodeSOF
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def njDecodeSOF():
ssxmax = 0
ssymax = 0
njDecodeLength()
if (nj.length < 9):
- 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 __init__
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self, title=None, geom=None, handleArgs=True, language=None,
startWindow=None, useTtk=False, useSettings=False, showIcon=True, **kwargs
):
""" constructor - sets up the empty GUI window, and inits the various properties """
Function _soundWrap
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def _soundWrap(self, sound, isFile=False, repeat=False, wait=False):
self._loadWinsound()
if self.platform == self.WINDOWS and winsound is not False:
sound = self._translateSound(sound)
if self.userSounds is not None and sound 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
Function _positionWidget
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def _positionWidget( self, widget, row, column=0, colspan=0, rowspan=0, sticky=W+E, updateBg=True):
# allow item to be added to container
container = self.getContainer()
if updateBg and not self.ttkFlag:
gui.SET_WIDGET_FG(widget, self._getContainerFg())
- 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 deleteColumn
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def deleteColumn(self, columnNumber, callFunction=False):
if columnNumber < 0 or columnNumber >= self.numColumns:
raise Exception("Invalid column number: %s.", columnNumber)
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 undo_filter
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def undo_filter(self, filter_type, scanline, previous):
"""Undo the filter for a scanline. `scanline` is a sequence of
bytes that does not include the initial filter type byte.
`previous` is decoded previous scanline (for straightlaced
images this is the previous pixel row, but for interlaced
- 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
Reader
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Reader:
"""
PNG decoder in pure Python.
"""
Function setBg
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def setBg(self, colour, override=False, tint=False):
if not self.ttkFlag:
if self._getContainerProperty('type') == WIDGET_NAMES.RootPage:
# removed this - it makes the screen do funny stuff
# self.appWindow.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 read_pnm_header
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def read_pnm_header(infile, supported=(b'P5', b'P6')):
"""
Read a PNM header, returning (format,width,height,depth,maxval).
`width` and `height` are in pixels. `depth` is the number of
channels in the image; for PBM and PGM it is synthesized as 1, for
- 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"