jarvisteach/appJar

View on GitHub

Showing 542 of 3,395 total issues

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

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

    def configure(self, cnf=None, **kw):
        # properties to propagate to CheckBoxes
        cbVals = ['activebackground', 'activeforeground',
                  'highlightcolor', 'highlightbackground',
                  'indicatoron', 'state', 'selectcolor',
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 _entryMaker has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _entryMaker(self, title, row=None, column=0, colspan=0, rowspan=0, secret=False, label=False, kind="standard", words=None, **kwargs):
        # used by file entries
        text = kwargs.pop("text", None) 
        default = kwargs.pop("default", 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 addMenuList has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def addMenuList(self, menuName, names, funcs):
        # deal with a dict_keys object - messy!!!!
        if not isinstance(names, list):
            names = list(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 openBox has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def openBox(self, title=None, dirName=None, fileTypes=None, asFile=False, parent=None, multiple=False, mode='r'):

        self.topLevel.update_idletasks()

        # define options for opening
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 _buildQueryURL has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _buildQueryURL(self):
        self.request = self.MAP_URL + urlencode(self.params)
        if len(self.markers) > 0:
            m = ""
            for mark in self.markers:
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 check_color has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def check_color(c, greyscale, which):
    """Checks that a colour argument for transparent or
    background options is the right form.  Returns the colour
    (which, if it's a bar integer, is "corrected" to a 1-tuple).
    """
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 undo_filter_paeth has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        def undo_filter_paeth(filter_unit, scanline, previous, result):
            """Undo Paeth filter."""

            # Also used for ci.
            ai = -filter_unit
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 _process_tRNS has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _process_tRNS(self, data):
        # http://www.w3.org/TR/PNG/#11tRNS
        self.trns = data
        if self.colormap:
            if not self.plte:
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 configure has 35 lines of code (exceeds 25 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 1 hr to fix

    Function addPlot has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def addPlot(self, title, t, s, row=None, column=0, colspan=0, rowspan=0, width=None, height=None, showNav=False):
    Severity: Major
    Found in appJar/appjar.py - About 1 hr to fix

      Function _buttonMaker has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _buttonMaker(self, title, func, kind, extra=None, row=None, column=0, colspan=0, rowspan=0, *args, **kwargs):
      Severity: Major
      Found in appJar/appjar.py - About 1 hr to fix

        Function __init__ has 11 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 _entryMaker has 11 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _entryMaker(self, title, row=None, column=0, colspan=0, rowspan=0, secret=False, label=False, kind="standard", words=None, **kwargs):
          Severity: Major
          Found in appJar/appjar.py - About 1 hr to fix

            Function test_message_boxes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def test_message_boxes():
                print("\tTesting messages")
                assert isinstance(app.addMessage("m1", TEXT_ONE), Message)
                app.addMessage("m2", TEXT_TWO)
                with pytest.raises(Exception) :
            Severity: Minor
            Found in tests/widget_test.py - About 1 hr to fix

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

                  def __init__(self, parent, title=None, **opts):
                      # get the fonts
                      buttonFont = opts.pop('buttonFont', None)
                      titleFont = opts.pop('titleFont', None)
              
              
              Severity: Minor
              Found in appJar/appjar.py - About 1 hr to fix

                Function startLabelFrame has 10 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def startLabelFrame(self, title, row=None, column=0, colspan=0, rowspan=0, sticky=W, hideTitle=False, label=None, name=None):
                Severity: Major
                Found in appJar/appjar.py - About 1 hr to fix

                  Function addLabelSpinBoxRange has 10 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def addLabelSpinBoxRange(self, title, fromVal, toVal, row=None, column=0, colspan=0, rowspan=0, label=True, **kwargs):
                  Severity: Major
                  Found in appJar/appjar.py - About 1 hr to fix

                    Function _importAjtree has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _importAjtree(self):
                            """ loads tree support - and creates tree classes """
                            global parseString, TreeItem, TreeNode
                    
                            if TreeNode is 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 setCheckBox has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def setCheckBox(self, title, ticked=True, callFunction=True):
                            cb = self.widgetManager.get(WIDGET_NAMES.CheckBox, title)
                            bVar = self.widgetManager.get(WIDGET_NAMES.CheckBox, title, group=WidgetManager.VARS)
                            bVar.set(ticked)
                            if ticked:
                    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