Showing 542 of 3,395 total issues
Function startPagedWindow
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def startPagedWindow(self, title, row=None, column=0, colspan=0, rowspan=0):
Avoid deeply nested control flow statements. Open
Open
with app.panedFrame("c"): app.label("Pane 3")
with app.panedFrame("d"): app.label("Pane 4")
Function addTurtle
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def addTurtle(self, title, row=None, column=0, colspan=0, rowspan=0):
Function addCanvasCircle
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def addCanvasCircle(self, title, x, y, diameter, **kwargs):
Avoid deeply nested control flow statements. Open
Open
with app.panedFrameVertical("b"): app.label("Pane 2")
with app.panedFrame("c"): app.label("Pane 3")
Function setLocation
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def setLocation(self, x, y=None, ignoreSettings=None, win=None, up=0):
Function addMicroBit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def addMicroBit(self, title, row=None, column=0, colspan=0, rowspan=0):
Function addDatePicker
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def addDatePicker(self, name, row=None, column=0, colspan=0, rowspan=0):
Function showSplash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def showSplash(self, text="appJar", fill="#FF0000", stripe="#000000", fg="#FFFFFF", font=44):
Function _buildOptionBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _buildOptionBox(self, frame, title, options, kind="normal", disabled='-'):
Function addCanvasImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def addCanvasImage(self, title, x, y, image=image, **kwargs):
Avoid deeply nested control flow statements. Open
Open
with app.panedFrame("right"):
app.slider("TransparencyScale", 100, change=scale, interval=25)
app.spin("TransparencySpin", value=0, endValue=100, item='100', change=scale)
app.slider("FontScale", 12, show=True, change=scale, range=(6,40))
Function setOptionBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def setOptionBox(self, title, index, value=True, callFunction=True, override=False):
Function addGoogleMap
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def addGoogleMap(self, title, row=None, column=0, colspan=0, rowspan=0):
Function plot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot(self, title, t=None, s=None, *args, **kwargs):
Function addCanvas
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def addCanvas(self, title, row=None, column=0, colspan=0, rowspan=0):
Function addCanvasText
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def addCanvasText(self, title, x, y, text=None, **kwargs):
Function setCanvasEvent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def setCanvasEvent(self, title, item, event, function, add=None):
Function move
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def move(direction):
if direction == ">":
for item in app.getListBox("Animals"):
app.addListItem("Sports",item)
app.removeListItem("Animals", 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
Avoid deeply nested control flow statements. Open
Open
for i in range(5):
l = "DD"+str(i)
app.label(l, l, pos=(0, i), tip=colours[i], bg=colours[i], fg="white", drag=[drag, drop])