capocchi/DEVSimPy

View on GitHub

Showing 729 of 1,315 total issues

Function OnMotion has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
Open

        def OnMotion(self, event):
            """ Motion manager.
            """ 

            ### current cursor
Severity: Minor
Found in Container.py - About 1 day 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

File PluginsGUI.py has 689 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
# PluginGUI.py ---
#                    --------------------------------
Severity: Major
Found in PluginsGUI.py - About 1 day to fix

    Function directConnect has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
    Open

        def directConnect(self):
            """
            Direct connect this kernel's model
            """
            if self.directConnected:
    Severity: Minor
    Found in DEVSKernel/PyPDEVS/old/basesimulator.py - About 1 day 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

    File Components.py has 670 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    
    ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
    # Components.py ---
    #                    --------------------------------
    Severity: Major
    Found in Components.py - About 1 day to fix

      File DEVS.py has 668 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: Latin-1 -*-
      """
      Classes and tools for DEVS model specification
      """
      
      
      Severity: Major
      Found in DEVSKernel/PyPDEVS/pypdevs221/src/DEVS.py - About 1 day to fix

        File PreferencesGUI.py has 625 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        
        ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
        # PreferencesGUI.py ---
        #                    --------------------------------
        Severity: Major
        Found in PreferencesGUI.py - About 1 day to fix

          File WizardGUI.py has 618 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          
          ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
          # WizardGUI.py ---
          #                    --------------------------------
          Severity: Major
          Found in WizardGUI.py - About 1 day to fix

            Function run has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
            Open

                def run(self):
                    tokens = tokenize.generate_tokens(self.getline)
                    for _token in tokens:
                        self.tokeneater(*_token)
                    # Remove trailing empty lines.
            Severity: Minor
            Found in reindent.py - About 1 day 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

            File DEVS.py has 607 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: Latin-1 -*-
            ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
            # DEVS.py --- Classes and Tools for DEVS Model Specification
            #                     --------------------------------
            #                            Copyright (c) 2013
            Severity: Major
            Found in DEVSKernel/PyPDEVS/old/DEVS.py - About 1 day to fix

              Function whichgen has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
              Open

              def whichgen(command, path=None, verbose=0, exts=None):
                  """Return a generator of full paths to the given command.
                  
                  "command" is a the name of the executable to search for.
                  "path" is an optional alternate path list to search. The default it
              Severity: Minor
              Found in which.py - About 1 day 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

              BaseSimulator has 67 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class BaseSimulator(Solver):
                  """
                  The BaseSimulator class, this is the core of the complete simulation and
                  is exported with Pyro as the representation of a server.
                  """
              Severity: Major
              Found in DEVSKernel/PyPDEVS/old/basesimulator.py - About 1 day to fix

                Function simulator_factory has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                Open

                def simulator_factory(model, strategy, prof, ntl, verbose, dynamic_structure_flag, real_time_flag):
                    """ Preventing direct creation for Simulator
                        disallow direct access to the classes
                    """
                
                
                Severity: Minor
                Found in Patterns/Factory.py - About 1 day 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

                File simulator.py has 565 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: Latin-1 -*-
                """
                Main simulator class to be used as an interface to the user
                """
                
                
                Severity: Major
                Found in DEVSKernel/PyPDEVS/pypdevs221/src/simulator.py - About 1 day to fix

                  Function guessDelimiter has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def guessDelimiter(input, textQualifier = '"'):
                      """
                      PROTOTYPE:
                        guessDelimiter(input, textQualifier = '\"')
                      DESCRIPTION:
                  Severity: Minor
                  Found in DSV.py - About 1 day 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 allocate has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def allocate(self, models, edges, nrnodes, totalActivities):
                          """
                          Calculate allocations for the nodes, using the information provided.
                  
                          :param models: the models to allocte
                  Severity: Minor
                  Found in DEVSKernel/PyPDEVS/pypdevs221/src/greedyAllocator.py - About 1 day 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 BuildZipPackage has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def BuildZipPackage(self) -> None:
                          """
                          """
                       
                          ### create the outfn zip file
                  Severity: Minor
                  Found in StandaloneNoGUI.py - About 1 day 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 directConnect has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def directConnect(componentSet, local):
                      """
                      Perform direct connection on this CoupledDEVS model
                  
                      :param componentSet: the iterable to direct connect
                  Severity: Minor
                  Found in DEVSKernel/PyPDEVS/pypdevs221/src/DEVS.py - About 1 day 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

                  File SimulationGUI.py has 543 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  
                  ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
                  # SimulationGUI.py ---
                  #                    --------------------------------
                  Severity: Major
                  Found in SimulationGUI.py - About 1 day to fix

                    ShapeCanvas has 62 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                        class ShapeCanvas(wx.ScrolledWindow, Abstractable, Subject):
                            """ ShapeCanvas class.
                            """
                    
                            ID = 0
                    Severity: Major
                    Found in Container.py - About 1 day to fix

                      File simconfig.py has 536 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """
                      Module with the specific aim of creating a more simple configuration interface for the simulator.
                      """
                      from . import middleware
                      from .util import DEVSException
                      Severity: Major
                      Found in DEVSKernel/PyPDEVS/pypdevs221/src/simconfig.py - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language