jarvisteach/appJar

View on GitHub

Showing 542 of 3,395 total issues

Function _makeAjTreeData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def _makeAjTreeData(self):
        # implementation of container for XML data
        # functions implemented as specified in skeleton
        class AjTreeData(TreeItem, object):

Severity: Minor
Found in appJar/appjar.py - About 4 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 deleteRow has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def deleteRow(self, position, pauseUpdate=False, callFunction=False):
        if 0 > position >= len(self.cells):
            raise Exception("Invalid row number.")
        else:
            # forget the specified row & button
Severity: Minor
Found in appJar/appjar.py - About 4 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 logMessage has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    def logMessage(msg, level, *args):
        """ allows user to log a message - provide a message and a log level
            any %s tags in the message will be replaced by the relevant positional *args """
        frames = inspect.stack()
        # try to ensure we only log extras if we're called from above functions
Severity: Minor
Found in appJar/appjar.py - About 4 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 go has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    def go(self, language=None, startWindow=None):
        """ Most important function! starts the GUI """

        # check if we have a command line language
        if self._language is not None:
Severity: Minor
Found in appJar/appjar.py - About 4 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 _makeAccess has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    def _makeAccess(self):
        if not self.accessMade:
            def _close(): self.hideSubWindow("access_access_subwindow")
            def _changeFg(): self.label("access_fg_colBox", bg=self.colourBox(self.getLabelBg("access_fg_colBox")))
            def _changeBg(): self.label("access_bg_colBox", bg=self.colourBox(self.getLabelBg("access_bg_colBox")))
Severity: Minor
Found in appJar/appjar.py - About 4 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 menu has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    def menu(self, menu, name=None, func=None, **kwargs):
        # kind: menu, sub, button, sep, check/tick, radio
        kind = kwargs.pop('kind', 'button')
        group = kwargs.pop('group', None)
        shortcut = kwargs.pop('shortcut', None)
Severity: Minor
Found in appJar/appjar.py - About 4 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 njDecodeDHT has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def njDecodeDHT():
    counts = [0] * 16
    njDecodeLength()
    while (nj.length >= 17):
        i = nj.spos[nj.pos]
Severity: Minor
Found in appJar/lib/nanojpeg.py - About 4 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_lists has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def test_lists():
    print("\tTesting lists")

    assert isinstance(app.addListBox("l1", LIST_ONE), Listbox)
    app.addListBox("l2", LIST_TWO)
Severity: Major
Found in tests/widget_test.py - About 4 hrs to fix

    Function _updateEntryDefault has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def _updateEntryDefault(self, name, mode=None):
            var = self.widgetManager.get(WIDGET_NAMES.Entry, name, group=WidgetManager.VARS)
            entry = self.widgetManager.get(WIDGET_NAMES.Entry, name)
    
            # ignore this if no default to apply
    Severity: Minor
    Found in appJar/appjar.py - About 3 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 _configWidget has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def _configWidget(self, title, kind, **kwargs):
            widget = self.widgetManager.get(kind, title)
            # remove any unwanted keys
            for key in ["row", "column", "colspan", "rowspan", "label", "name"]:
                kwargs.pop(key, None)
    Severity: Minor
    Found in appJar/appjar.py - About 3 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 addColumn has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def addColumn(self, columnNumber, data, callFunction=False):
            if columnNumber < 0 or columnNumber > self.numColumns:
                raise Exception("Invalid column number.")
            else:
                self._hideEntryBoxes()
    Severity: Minor
    Found in appJar/appjar.py - About 3 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 njDecodeSOF has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    def njDecodeSOF():
        ssxmax = 0
        ssymax = 0
        njDecodeLength()
        if (nj.length < 9):
    Severity: Minor
    Found in appJar/lib/nanojpeg.py - About 3 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 __init__ has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(
                        self, title=None, geom=None, handleArgs=True, language=None,
                        startWindow=None, useTtk=False, useSettings=False, showIcon=True, **kwargs
                    ):
            """ constructor - sets up the empty GUI window, and inits the various properties """
    Severity: Major
    Found in appJar/appjar.py - About 3 hrs to fix

      Function _soundWrap has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          def _soundWrap(self, sound, isFile=False, repeat=False, wait=False):
              self._loadWinsound()
              if self.platform == self.WINDOWS and winsound is not False:
                  sound = self._translateSound(sound)
                  if self.userSounds is not None and sound is not None:
      Severity: Minor
      Found in appJar/appjar.py - About 3 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 _positionWidget has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def _positionWidget( self, widget, row, column=0, colspan=0, rowspan=0, sticky=W+E, updateBg=True):
              # allow item to be added to container
              container = self.getContainer()
              if updateBg and not self.ttkFlag:
                  gui.SET_WIDGET_FG(widget, self._getContainerFg())
      Severity: Minor
      Found in appJar/appjar.py - About 3 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 deleteColumn has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def deleteColumn(self, columnNumber, callFunction=False):
      
              if columnNumber < 0 or columnNumber >= self.numColumns:
                  raise Exception("Invalid column number: %s.", columnNumber)
              else:
      Severity: Minor
      Found in appJar/appjar.py - About 3 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 undo_filter has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def undo_filter(self, filter_type, scanline, previous):
              """Undo the filter for a scanline.  `scanline` is a sequence of
              bytes that does not include the initial filter type byte.
              `previous` is decoded previous scanline (for straightlaced
              images this is the previous pixel row, but for interlaced
      Severity: Minor
      Found in appJar/lib/png.py - About 3 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

      Reader has 29 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Reader:
          """
          PNG decoder in pure Python.
          """
      
      
      Severity: Minor
      Found in appJar/lib/png.py - About 3 hrs to fix

        Function setBg has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            def setBg(self, colour, override=False, tint=False):
                if not self.ttkFlag:
                    if self._getContainerProperty('type') == WIDGET_NAMES.RootPage:
        # removed this - it makes the screen do funny stuff
        #                self.appWindow.config(background=colour)
        Severity: Minor
        Found in appJar/appjar.py - About 3 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 read_pnm_header has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

        def read_pnm_header(infile, supported=(b'P5', b'P6')):
            """
            Read a PNM header, returning (format,width,height,depth,maxval).
            `width` and `height` are in pixels.  `depth` is the number of
            channels in the image; for PBM and PGM it is synthesized as 1, for
        Severity: Minor
        Found in appJar/lib/png.py - About 3 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

        Severity
        Category
        Status
        Source
        Language