jarvisteach/appJar

View on GitHub

Showing 542 of 3,395 total issues

Function radioButton has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def radioButton(self, title, name=None, *args, **kwargs):
        """ simpleGUI - adds, sets & gets radioButtons all in one go """
        widgKind = WIDGET_NAMES.RadioButton
        selected = kwargs.pop("selected", False)
        callFunction = kwargs.pop("callFunction", True)
Severity: Minor
Found in appJar/appjar.py - About 2 hrs 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 dnd_end has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def dnd_end(self, target, event):
        gui.trace("<<DRAGGABLE_WIDGET.dnd_end>> %s target=%s", self.Name, target)

        # from somewhere, dropped nowhere - self destruct, or put back
        if self.Canvas is None:
Severity: Minor
Found in appJar/appjar.py - About 2 hrs 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 _prepareCopyAndPasteMenu has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def _prepareCopyAndPasteMenu(self, event, widget=None):
        if self.copyAndPaste.inUse:
            if event is not None:
                widget = event.widget
            self._changeMenuState(self.widgetManager.get(WIDGET_NAMES.Menu, "EDIT"), DISABLED, 'Disabling', 10)
Severity: Minor
Found in appJar/appjar.py - About 2 hrs 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 test_gui_options has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def test_gui_options():
    print("\tTesting gui options")
    app.setTitle("New title")
    assert app.getTitle() == "New title"
    assert app.title == "New title"
Severity: Major
Found in tests/widget_test.py - About 2 hrs to fix

    Function test_menus has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def test_menus():
        print("\tTesting Menubar")
    
        app.addMenuList("a", LIST_ONE, tester_function)
        app.createMenu("MEN2")
    Severity: Major
    Found in tests/widget_test.py - About 2 hrs to fix

      Function test_setters has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def test_setters(widg_type, widg_id, widg_val=None):
          print("\tTesting setters")
          exec("app.set" + widg_type + "Bg(\""+widg_id +"\", \"red\")")
          exec("app.set" + widg_type + "Fg(\""+widg_id +"\", \"red\")")
          exec("app.set" + widg_type + "DisabledFg(\""+widg_id +"\", \"red\")")
      Severity: Major
      Found in tests/widget_test.py - About 2 hrs to fix

        Function test_properties has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def test_properties():
            print("\tTesting properties")
        
            app.startToggleFrame("PP_frame")
            assert isinstance(app.addProperties("tog_p1", HASH_ONE), Properties)
        Severity: Major
        Found in tests/widget_test.py - About 2 hrs to fix

          Function hideWidgetType has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

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

              def stop(self, event=None):
                  """ Closes the GUI. If a stop function is set, will only close the GUI if True """
                  theFunc = self._getTopLevel().stopFunction
                  if theFunc is None or theFunc():
          
          
          Severity: Minor
          Found in appJar/appjar.py - About 2 hrs 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 getEntry has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              def getEntry(self, name):
                  entry = self.widgetManager.get(WIDGET_NAMES.Entry, name)
                  if entry.showingDefault:
                      if entry.isNumeric:
                          return None
          Severity: Minor
          Found in appJar/appjar.py - About 2 hrs 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 _changeMenuState has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              def _changeMenuState(self, menu, state, text, limit=None):
                  # changes the specified menu object's state to the new state, using the specified text for logging
                  numMenus = menu.index("end")
                  if numMenus is not None: # MAC_APP (and others?) returns None
                      for item in range(numMenus+1):
          Severity: Minor
          Found in appJar/appjar.py - About 2 hrs 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 chunk has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              def chunk(self, seek=None, lenient=False):
                  """
                  Read the next PNG chunk from the input file; returns a
                  (*type*, *data*) tuple.  *type* is the chunk's type as a
                  byte string (all PNG chunk types are 4 bytes long).
          Severity: Minor
          Found in appJar/lib/png.py - About 2 hrs 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 check_palette has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

          def check_palette(palette):
              """Check a palette argument (to the :class:`Writer` class)
              for validity.  Returns the palette as a list if okay; raises an
              exception otherwise.
              """
          Severity: Minor
          Found in appJar/lib/png.py - About 2 hrs 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 njDecode has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

          def njDecode(jpeg, size):
              njDone()
              nj.spos = jpeg
              nj.pos = 0
              nj.size = size & 0x7FFFFFFF
          Severity: Minor
          Found in appJar/lib/nanojpeg.py - About 2 hrs 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 addDbTable has 16 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def addDbTable(self, title, value, table, row=None, column=0, colspan=0, rowspan=0,
          Severity: Major
          Found in appJar/appjar.py - About 2 hrs to fix

            Function __init__ has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def __init__(self, parent, app, defaultLocation="Marlborough, UK", proxyString=None, useTtk=False, font=None):
                    super(GoogleMap, self).__init__(parent, text="GoogleMaps")
                    self.alive = True
                    self.API_KEY = ""
                    self.parent = parent
            Severity: Minor
            Found in appJar/appjar.py - About 2 hrs to fix

              Function _configOptionBoxList has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _configOptionBoxList(self, title, options, kind):
                      """ Tidies up the list provided when an OptionBox is created/changed
              
                      :param title: the title for the OptionBox - only used by TickOptionBox to calculate max size
                      :param options: the list to tidy
              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 setToolbarDisabled has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def setToolbarDisabled(self, disabled=True):
                      for but in self.widgetManager.group(WIDGET_NAMES.Toolbar).keys():
                          if disabled:
                              self.widgetManager.get(WIDGET_NAMES.Toolbar, but).config(state=DISABLED)
                          else:
              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 setUp has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def setUp(self, widget):
                      self.inUse = True
                      # store globals
                      w = widget
                      wt = gui.GET_WIDGET_CLASS(widget)
              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 toolbar has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def toolbar(self, names, funcs, **kwargs):
                      """ simpleGUI - shortener for toolbar """
                      icons = kwargs.pop('icons', kwargs.pop('findIcon', False))
                      pinned = kwargs.pop('pinned', None)
                      disabled = kwargs.pop('disabled', 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

              Severity
              Category
              Status
              Source
              Language