Showing 542 of 3,395 total issues
Avoid too many return
statements within this function. Open
if (nj.error != __NJ_FINISHED): return nj.error
Avoid too many return
statements within this function. Open
elif kind == "text": return self.textBox(title, message, parent)
Avoid too many return
statements within this function. Open
return nj.error
Avoid too many return
statements within this function. Open
elif kind == "float": return self.floatBox(title, message, parent)
Avoid too many return
statements within this function. Open
elif kind == "integer": return self.integerBox(title, message, parent)
Avoid too many return
statements within this function. Open
elif kind == "number": return self.numberBox(title, message, parent)
Function _loadConfigParser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _loadConfigParser(self):
""" loads the ConfigParser, used by internationalisation & settings """
global ConfigParser, ParsingError, codecs
if ConfigParser is None:
try:
- 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 _loadThreading
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _loadThreading(self):
""" loads threading classes, and sets up queue """
global Thread, Queue
if Thread is None:
try:
- 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 _loadInternalDnd
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _loadInternalDnd(self):
""" loads the internal dnd libraries """
global INTERNAL_DND, types
if INTERNAL_DND is None:
try:
- 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 _checkMode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _checkMode(self):
""" internal function to warn about issues in certain modes """
# detect if we're in interactive mode
if hasattr(sys, 'ps1'):
self.warn("Interactive mode is not fully tested, some features might not work.")
- 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 _getRCS
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _getRCS(self, row, column, colspan, rowspan):
if row in[-1, 'previous', 'p', 'pr']:
row = self._getContainerProperty('emptyRow') - 1
else:
# this is the default,
- 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 _removeContainer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _removeContainer(self):
if len(self.containerStack) == 1:
raise Exception("Can't remove container, already in root window.")
else:
container = self.containerStack.pop()
- 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 _registerExternalDropTarget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _registerExternalDropTarget(self, title, widget, function=None, replace=True):
""" register a widget to receive external drag events """
self._loadExternalDnd()
if EXTERNAL_DND is not 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 _addPlotFig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _addPlotFig(self, title, row=None, column=0, colspan=0, rowspan=0, width=None, height=None, showNav=False):
self.widgetManager.verify(WIDGET_NAMES.Plot, title)
self._loadMatplotlib()
if PlotCanvas is False:
raise Exception("Unable to load MatPlotLib - plots not available")
- 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 link
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def link(self, title, value=None, *args, **kwargs):
""" simpleGUI - adds, sets & gets links all in one go """
widgKind = WIDGET_NAMES.Link
try: self.widgetManager.verify(widgKind, title)
- 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 removeToolbarButton
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def removeToolbarButton(self, name, hide=True):
if (name not in self.widgetManager.group(WIDGET_NAMES.Toolbar)):
raise Exception("Unknown toolbar name: " + name)
self.widgetManager.get(WIDGET_NAMES.Toolbar, name).destroy()
self.widgetManager.remove(WIDGET_NAMES.Toolbar, name)
- 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 microbit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def microbit(self, title, *args, **kwargs):
'''simpleGUI - adds, sets & gets microbits all in one go'''
widgKind = WIDGET_NAMES.MicroBit
image = kwargs.pop("image", None)
brightness = kwargs.pop("brightness", 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 getSelectedCells
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getSelectedCells(self):
selectedCells = []
for row in self.cells:
for cell in row:
if cell.selected:
- 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 selectListItemAtPos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def selectListItemAtPos(self, title, pos, callFunction=False):
lb = self.widgetManager.get(WIDGET_NAMES.ListBox, title)
if lb.size() == 0:
gui.warn("No items in list: %s, unable to select item at pos: %s", title, pos)
return 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 convertJpgToBmp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def convertJpgToBmp(self, image):
self._loadNanojpeg()
if nanojpeg is False:
raise Exception(
"nanojpeg library not found, unable to display jpeg files: " + image)
- 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"