jarvisteach/appJar

View on GitHub

Showing 542 of 3,395 total issues

Function test_options has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def test_options():
    print("\tTesting options")
    # add two option boxes
    assert isinstance(app.addOptionBox("l1", LIST_ONE), OptionMenu)
    app.addOptionBox("l2", LIST_TWO)
Severity: Major
Found in tests/widget_test.py - About 3 hrs to fix

    Function test_scales has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def test_scales():
        print("\tTesting scales")
        assert isinstance(app.addScale("s1"), Scale)
        app.addScale("s2")
        with pytest.raises(Exception) :
    Severity: Major
    Found in tests/widget_test.py - About 3 hrs to fix

      Function configure has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def configure(self, cnf=None, **kw):
              kw = gui.CLEAN_CONFIG_DICTIONARY(**kw)
              updateCells = False
      
              if "disabledentries" in kw:
      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 has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def read(self, lenient=False):
              """
              Read the PNG file and decode it.  Returns (`width`, `height`,
              `pixels`, `metadata`).
      
      
      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

      Function image has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          def image(self, title, value=None, *args, **kwargs):
              """ simpleGUI - adds, sets & gets images all in one go """
      
              widgKind = WIDGET_NAMES.Image
              kind = kwargs.pop("kind", "standard").lower().strip()
      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 entry has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          def entry(self, title, value=None, *args, **kwargs):
              """ simpleGUI - adds, sets & gets entries all in one go """
              widgKind = WIDGET_NAMES.Entry
              default = kwargs.pop("default", None)
              limit = kwargs.pop("limit", 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 _makeLink has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def _makeLink():
              class Link(labelBase, object):
      
                  def __init__(self, *args, **kwargs):
                      self.useTtk = kwargs.pop('useTtk',False)
      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 selectColumn has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def selectColumn(self, columnNumber, highlight=None):
              if columnNumber < 0 or columnNumber >= self.numColumns:
                  raise Exception("Invalid column number.")
              else:
                  try:
      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 njShowBits has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      def njShowBits(bits):
          if (not bits): return 0
          while (nj.bufbits < bits):
              if (nj.size <= 0):
                  nj.buf = (nj.buf << 8) | 0xFF
      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 asDirect has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def asDirect(self):
              """Returns the image data as a direct representation of an
              ``x * y * planes`` array.  This method is intended to remove the
              need for callers to deal with palettes and transparency
              themselves.  Images with a palette (colour type 3)
      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 saveSettings has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def saveSettings(self, fileName="appJar.ini"):
              """ saves the current settings to a file
                  called automatically by stop() of settings were loaded at start """
              self._loadConfigParser()
              if not ConfigParser:
      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 selectRow has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def selectRow(self, rowNumber, highlight=None):
      
              if rowNumber == "h": rowNumber = 0
              else: rowNumber = int(rowNumber) + 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 _main has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      def _main(argv):
          """
          Run the PNG encoder with options from the command line.
          """
      
      
      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 test_checks has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def test_checks():
          print("\tTesting checks")
          assert isinstance(app.addCheckBox(TEXT_ONE), Checkbutton)
          app.addCheckBox(TEXT_TWO)
          with pytest.raises(Exception):
      Severity: Major
      Found in tests/widget_test.py - About 2 hrs to fix

        GoogleMap has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class GoogleMap(LabelFrame, object):
            """ Class to wrap a GoogleMap tile download into a widget"""
        
            def __init__(self, parent, app, defaultLocation="Marlborough, UK", proxyString=None, useTtk=False, font=None):
                super(GoogleMap, self).__init__(parent, text="GoogleMaps")
        Severity: Minor
        Found in appJar/appjar.py - About 2 hrs to fix

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

              def __init__(self, width=None, height=None,
          Severity: Major
          Found in appJar/lib/png.py - About 2 hrs to fix

            Function cleanseWidgets has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                def cleanseWidgets(self, widget):
                    widgType = gui.GET_WIDGET_CLASS(widget)
                    gui.trace("Attempting to cleanse: %s", widgType)
            
                    # make sure we've cleansed any children first
            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 _buildEntry has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                def _buildEntry(self, title, frame, secret=False, words=[]):
                    self.widgetManager.verify(WIDGET_NAMES.Entry, title)
                    # if we are an autocompleter
                    if len(words) > 0:
                        ent = self._makeAutoCompleteEntry()(words, self._getTopLevel(), frame)
            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 _buildFileEntry has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                def _buildFileEntry(self, title, frame, kind='save', text=None, default=None):
            
                    vFrame = self._makeButtonBox()(frame)
                    self.widgetManager.log(WIDGET_NAMES.FrameBox, vFrame)
            
            
            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 convert has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                def convert(self):
                    alphapixels = []
                    if self.meta["alpha"] is True:
                        values = 4
                        a_append = alphapixels.append
            Severity: Minor
            Found in appJar/lib/tkinter_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

            Severity
            Category
            Status
            Source
            Language