jarvisteach/appJar

View on GitHub

Showing 542 of 3,395 total issues

Function _bindEvent has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    def _bindEvent(self, kind, name, widget, function, eventType, key=None):
        # this will discard the scale value, as default function
        # can't handle it
        if kind == WIDGET_NAMES.Scale:
            cmd = self.MAKE_FUNC(function, name)
Severity: Minor
Found in appJar/appjar.py - About 6 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 a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, width=None, height=None,
                 size=None,
                 greyscale=False,
                 alpha=False,
                 bitdepth=8,
Severity: Minor
Found in appJar/lib/png.py - About 6 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 SET_WIDGET_BG has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    def SET_WIDGET_BG(widget, bg, external=False, tint=False):

        if bg is None: # ignore empty colours
            return

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

def njDecodeScan():
    rstcount = nj.rstinterval
    nextrst = 0
    # nj_component_t* c;
    njDecodeLength()
Severity: Minor
Found in appJar/lib/nanojpeg.py - About 6 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 njConvert has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

def njConvert():
    for i in range(nj.ncomp):
        c = nj.comp[i]
        if NJ_CHROMA_FILTER:
            while ((c.width < nj.width) or (c.height < nj.height)):
Severity: Minor
Found in appJar/lib/nanojpeg.py - About 5 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

SimpleTable has 42 functions (exceeds 20 allowed). Consider refactoring.
Open

class SimpleTable(ScrollPane):

    def __init__(self, parent, title, data, action=None, addRow=None,
                    actionHeading="Action", actionButton="Press",
                    addButton="Add", showMenu=False, queueFunction=None, border='solid', **opts):
Severity: Minor
Found in appJar/appjar.py - About 5 hrs to fix

    Function test_gui_properties has 141 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def test_gui_properties():
    
        def propFunc(param=None): return True
    
        app.config(
    Severity: Major
    Found in tests/widget_test.py - About 5 hrs to fix

      Function _addRow has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          def _addRow(self, rowData):
              if self.numColumns == 0:
                  raise Exception("No columns to add to.")
              else:
                  gui.trace(rowData)
      Severity: Minor
      Found in appJar/appjar.py - About 5 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 SET_WIDGET_FG has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          def SET_WIDGET_FG(widget, fg, external=False):
              widgType = gui.GET_WIDGET_CLASS(widget)
              gui.trace("SET_WIDGET_FG: %s - %s", widgType, fg)
      
              # only configure these widgets if external
      Severity: Minor
      Found in appJar/appjar.py - About 5 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 configure has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          def configure(self, **kwargs):
              title = kwargs.pop("title", None)
              icon = kwargs.pop("icon", None)
              transparency = kwargs.pop("transparency", None)
              visible = kwargs.pop("visible", None)
      Severity: Minor
      Found in appJar/appjar.py - About 5 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 _menuHelper has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          def _menuHelper(self, action):
              self.update_idletasks()
              self.lastAction = action
              vals=self.lastSelected.gridPos.split("-")
              gui.trace('Table Menu Helper: %s-%s', action, vals)
      Severity: Minor
      Found in appJar/appjar.py - About 5 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 filter_scanline has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

      def filter_scanline(type, line, fo, prev=None):
          """Apply a scanline filter to a scanline.  `type` specifies the
          filter type (0 to 4); `line` specifies the current (unfiltered)
          scanline as a sequence of bytes; `prev` specifies the previous
          (unfiltered) scanline as a sequence of bytes. `fo` specifies the
      Severity: Minor
      Found in appJar/lib/png.py - About 5 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_text_areas has 125 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def test_text_areas():
          print("\tTesting text areas")
          assert isinstance(app.addTextArea("t1"), AjText)
          ta2 = app.addTextArea("t2")
          with pytest.raises(Exception) :
      Severity: Major
      Found in tests/widget_test.py - About 5 hrs to fix

        Function write_passes has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            def write_passes(self, outfile, rows, packed=False):
                """
                Write a PNG image to the output file.
        
                Most users are expected to find the :meth:`write` or
        Severity: Minor
        Found in appJar/lib/png.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 spinBox has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

            def spinBox(self, title, value=None, *args, **kwargs):
                """ simpleGUI - adds, sets & gets spinBoxes all in one go """
                widgKind = WIDGET_NAMES.SpinBox
        
                endValue = kwargs.pop("endValue", 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 destroyWidget has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

            def destroyWidget(self, widgType, widget):
                widgets = self.widgets[widgType]
                # just a list, remove matching obj - no vars
                if type(widgets) in (list, tuple):
                    gui.trace('Removing widget: %s, %s', widgType, widget)
        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 _getImage has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

            def _getImage(self, imagePath, checkCache=True, addToCache=True):
                if imagePath is None:
                    return None
        
                # get the full image path
        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 addMenuItem has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            def addMenuItem(self, title, item, func=None, kind=None, shortcut=None, underline=-1, rb_id=None, createBinding=True):
                # set the initial menubar
                self._initMenu()
        
                # get or create an initial menu
        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 startContainer has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

            def startContainer(self, fType, title, row=None, column=0, colspan=0, rowspan=0, sticky=None, name=None):
                if name is None: name = title
                if fType == WIDGET_NAMES.LabelFrame:
                    # first, make a LabelFrame, and position it correctly
                    self.widgetManager.verify(WIDGET_NAMES.LabelFrame, title)
        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 addToolbar has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            def addToolbar(self, names, funcs, findIcon=False, **kwargs):
                # hide the toolbarMin bar
                if self.tb.toolbarMin is not None:
                    self.tb.toolbarMin.pack_forget()
                # make sure the toolbar is showing
        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

        Severity
        Category
        Status
        Source
        Language