jarvisteach/appJar

View on GitHub

Showing 542 of 3,395 total issues

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

    def _validateNumericEntry(self, action, index, value_if_allowed, prior_value, text, validation_type, trigger_type, widget_name):
        if action == "1":
            if str(text) in '0123456789.-+':
                try:
                    if len(str(value_if_allowed)) == 1 and str(value_if_allowed) in '.-':
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 setToolbarPinned has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def setToolbarPinned(self, pinned=True):
        self.tb.pinned = pinned
        self._setPinBut()
        if not self.tb.pinned:
            if self.tb.pinBut is not 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 setRadioSquare has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def setRadioSquare(self, title, square=True):
        if self.platform == self.MAC:
            gui.warn("Square radiobuttons not available on Mac, for radiobutton %s", title)
        elif not self.ttkFlag:
            for k, v in self.widgetManager.group(WIDGET_NAMES.RadioButton).items():
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 njDecodeBlock has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def njDecodeBlock(c, sout, out):
    code = [0]
    value = 0
    coef = 0
    for i in range(len(nj.block)):
Severity: Minor
Found in appJar/lib/nanojpeg.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 asRGBA has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def asRGBA(self):
        """Return image as RGBA pixels.  Greyscales are expanded into
        RGB triplets; an alpha channel is synthesized if necessary.
        The return values are as for the :meth:`read` method
        except that the *metadata* reflect the returned pixels, not the
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 deinterlace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def deinterlace(self, raw):
        """
        Read raw pixel data, undo filters, deinterlace, and flatten.
        Return in flat row flat pixel format.
        """
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 array_scanlines_interlace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def array_scanlines_interlace(self, pixels):
        """
        Generator for interlaced scanlines from an array.  `pixels` is
        the full source image in flat row flat pixel format.  The
        generator yields each scanline of the reduced passes in turn, in
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 read_pam_header has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def read_pam_header(infile):
    """
    Read (the rest of a) PAM header.  `infile` should be positioned
    immediately after the initial 'P7' line (at the beginning of the
    second line).  Returns are as for `read_pnm_header`.
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 njRowIDCT has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, parent, title, data, action=None, addRow=None,
    Severity: Major
    Found in appJar/appjar.py - About 1 hr to fix

      Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, master, width=100, height=20,
      Severity: Major
      Found in appJar/appjar.py - About 1 hr to fix

        Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, master, width=100, height=20, bg='#FFFFFF',
        Severity: Major
        Found in appJar/appjar.py - About 1 hr to fix

          Function test_buttons has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def test_buttons():
              print("\tTesting buttons")
              with pytest.raises(Exception) :
                  app.addButton(["brk1", "brk1", "brk1", "brk1"], [None, None])
          
          
          Severity: Minor
          Found in tests/widget_test.py - About 1 hr to fix

            Function test_radios has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def test_radios():
                print("\tTesting radios")
                assert isinstance(app.addRadioButton("rb", TEXT_ONE), Radiobutton)
            
                app.addRadioButton("rb", TEXT_TWO)
            Severity: Minor
            Found in tests/widget_test.py - About 1 hr to fix

              Function __init__ has 36 lines of code (exceeds 25 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 1 hr to fix

                Function toolbar has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                def toolbar(btn):
                    print(btn)
                    if btn == "EXIT": app.stop()
                    elif btn == "LOGOUT": logout()
                    elif btn == "FILL": app.setTabBg("Tabs", app.getTabbedFrameSelectedTab("Tabs"), app.colourBox())
                Severity: Minor
                Found in appJar/examples/showcase.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 configureWidgets has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    def configureWidgets(self, kind, names, option, value):
                        if not isinstance(names, list):
                            self.configureWidget(kind, names, option, value)
                        else:
                            for widg in names:
                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 SET_LOCATION has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    def SET_LOCATION(x, y=None, ignoreSettings=None, win=None, up=0):
                        if ignoreSettings is not None:
                            win.ignoreSettings = ignoreSettings
                
                        if gui.GET_PLATFORM() != gui.LINUX:
                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 setSize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    def setSize(self, geom, height=None, ignoreSettings=None):
                        """ called to update screen geometry
                            can take a geom string, or a width & height
                            can override ignoreSettings if desired """
                        container = self._getTopLevel()
                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 removeWidgetType has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    def removeWidgetType(self, kind, name, collapse=False):
                        if kind == WIDGET_NAMES.RadioButton:
                            gui.error("Can't remove widget %s - %s", kind, name)
                            return
                            
                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