jarvisteach/appJar

View on GitHub

Showing 542 of 3,395 total issues

Function test_options has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def test_options():
    print("\tTesting options")
    # add two option boxes
    assert isinstance(app.addOptionBox("l1", LIST_ONE), OptionMenu)
    app.addOptionBox("l2", LIST_TWO)
Severity: Minor
Found in tests/widget_test.py - About 25 mins to fix

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 copy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def copy(self, sourceImage, fromBox=None, toBox=None):
        """Copies from region of sourceImage at fromBox to current image at toBox"""
        args = (self.name, "copy", sourceImage)
        if fromBox:
            if fromBox[0] == "-from":
Severity: Minor
Found in appJar/lib/tkinter_png.py - About 25 mins to fix

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

Severity
Category
Status
Source
Language