jarvisteach/appJar

View on GitHub

Showing 542 of 3,395 total issues

Function test_date_pickers has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def test_date_pickers():
    print("\tTesting date pickers")
    app.addDatePicker("d1")
    with pytest.raises(Exception) :
        app.addDatePicker("d1")
Severity: Minor
Found in tests/widget_test.py - About 1 hr to fix

    Function addTable has 15 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def addTable(self, title, data, row=None, column=0, colspan=0, rowspan=0, action=None, addRow=None,
    Severity: Major
    Found in appJar/appjar.py - About 1 hr to fix

      Function test_labels has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def test_labels():
          print("\tTesting labels")
          assert isinstance(app.addEmptyLabel("el1"), Label)
          assert isinstance(app.addLabel("l0", TEXT_ONE), Label)
          with pytest.raises(Exception) :
      Severity: Minor
      Found in tests/widget_test.py - About 1 hr to fix

        Function njColIDCT has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def njColIDCT(blk, p, sout, out, stride):
            x1 = blk[p + 8*4] << 8
            x2 = blk[p + 8*6]
            x3 = blk[p + 8*2]
            x4 = blk[p + 8*1]
        Severity: Minor
        Found in appJar/lib/nanojpeg.py - About 1 hr to fix

          Function test_images has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def test_images():
              print("\tTesting images")
          
              assert isinstance(app.addImage("im1", "1_flash.gif", compound="left"), PhotoImage)
              with pytest.raises(Exception) :
          Severity: Minor
          Found in tests/widget_test.py - About 1 hr to fix

            Function test_toolbars has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def test_toolbars():
                print("\tTesting Toolbar")
            
                app.addToolbar(["a", "b", "c", "ABOUT"], 
                    [tester_function, tester_function, tester_function, tester_function],
            Severity: Minor
            Found in tests/widget_test.py - About 1 hr to fix

              Function addDbGrid has 14 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def addDbGrid(self, title, db, table, row=None, column=0, colspan=0, rowspan=0, action=None, addRow=None,
              Severity: Major
              Found in appJar/appjar.py - About 1 hr to fix

                Function setPaneSashPosition has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def setPaneSashPosition(self, pos, pane=None):
                        # convert to a percentage if needed
                        if pos > 1: pos = pos / 100.0
                
                        if pane is None:
                Severity: Minor
                Found in appJar/appjar.py - About 1 hr 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 playNote has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def playNote(self, note, duration=200):
                        self._loadWinsound()
                        if self.platform == self.WINDOWS and winsound is not False:
                            try:
                                if isinstance(note, UNIVERSAL_STRING):
                Severity: Minor
                Found in appJar/appjar.py - About 1 hr 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 getAllInputs has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def getAllInputs(self, **kwargs):
                        """Get all values, merge & return as a single dictionary.
                
                        :param kwargs: will be _appended_ to the input list.
                
                
                Severity: Minor
                Found in appJar/appjar.py - About 1 hr 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 addButtons has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def addButtons(self, names, funcs, row=None, column=0, colspan=0, rowspan=0, fill=False):
                        ''' adds a 1D/2D list of buttons '''
                        if not isinstance(names, list):
                            raise Exception(
                                "Invalid button: " +
                Severity: Minor
                Found in appJar/appjar.py - About 1 hr 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 _lookupValue has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _lookupValue(self, myDict, val):
                        for name in myDict:
                            if isinstance(myDict[name], type([])):  # array of cbs
                                for rb in myDict[name]:
                                    if rb == val:
                Severity: Minor
                Found in appJar/appjar.py - About 1 hr 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 popUp has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def popUp(self, title, message=None, kind="info", parent=None):
                        """ simpleGUI - shortener for the various popUps """
                
                        if message is None:
                            message = title
                Severity: Minor
                Found in appJar/appjar.py - About 1 hr 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 __init__ has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(self, _guess=None, **kw):
                        """
                        Create a PNG decoder object.
                
                        The constructor expects exactly one keyword argument. If you
                Severity: Minor
                Found in appJar/lib/png.py - About 1 hr 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 addGrid has 13 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def addGrid(self, title, data, row=None, column=0, colspan=0, rowspan=0, action=None, addRow=None,
                Severity: Major
                Found in appJar/appjar.py - About 1 hr to fix

                  Function test_spins has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def test_spins():
                      print("\tTesting spins")
                  
                      assert isinstance(app.addSpinBox("s1", ["a", "b", "c", "d", "e"]), Spinbox)
                      app.addSpinBox("s2", ["a", "b", "c", "d", "e"])
                  Severity: Minor
                  Found in tests/widget_test.py - About 1 hr to fix

                    Function _bindDragEvent has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _bindDragEvent(self, kind, name, widget, functions, eventType, key=None):
                            functions = self._validateFunctionList(functions, "Drag")
                    
                            if kind == WIDGET_NAMES.Label:
                                widget.config(cursor="fleur")
                    Severity: Minor
                    Found in appJar/appjar.py - About 1 hr 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 showWidgetType has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def showWidgetType(self, kind, name):
                            items = self._getWidgetList(kind, name, limit=False)
                    
                            for item in items:
                                if self._widgetHasContainer(kind, item):
                    Severity: Minor
                    Found in appJar/appjar.py - About 1 hr 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 _getWidgetList has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _getWidgetList(self, kind, name, limit):
                            # gets a list of items of this type
                            # limit is used to only get a single radio button - for events
                            if kind == WIDGET_NAMES.RadioButton:
                                items = self.widgetManager.group(kind)
                    Severity: Minor
                    Found in appJar/appjar.py - About 1 hr 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 _fontHelper has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _fontHelper(self, font, *args, **kwargs):
                            if len(args) > 0:
                                if isinstance(args[0], int):
                                    kwargs={'size':args[0]}
                                elif isinstance(args[0], dict):
                    Severity: Minor
                    Found in appJar/appjar.py - About 1 hr 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