knipknap/exscript

View on GitHub

Showing 153 of 245 total issues

Function check_channel_pty_request has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def check_channel_pty_request(self,
Severity: Major
Found in Exscript/servers/sshd.py - About 50 mins to fix

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

        def __init__(self, name, lexer, parser, parent=None, *args, **kwargs):
    Severity: Minor
    Found in Exscript/interpreter/scope.py - About 45 mins to fix

      Function open has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def open(self, host, port=0):
              """Connect to a host.
      
              The optional second argument is the port number, which
              defaults to the standard telnet port (23).
      Severity: Minor
      Found in Exscript/protocols/telnetlib.py - About 45 mins 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 expect_prompt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def expect_prompt(self, consume=True):
              """
              Monitors the data received from the remote host and waits for a
              prompt in the response. The prompt attempts to use
              a sane default that works with many devices running Unix, IOS,
      Severity: Minor
      Found in Exscript/protocols/protocol.py - About 45 mins 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 eval has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def eval(self, command):
              """
              Evaluate the given string against all registered commands and
              return the defined response.
      
      
      Severity: Minor
      Found in Exscript/emulators/command.py - About 45 mins 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 acquire_account has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def acquire_account(self, account=None, owner=None):
              """
              Waits until an account becomes available, then locks and returns it.
              If an account is not passed, the next available account is returned.
      
      
      Severity: Minor
      Found in Exscript/account.py - About 45 mins 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 netlog has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def netlog(message,
      Severity: Minor
      Found in Exscript/util/syslog.py - About 45 mins to fix

        Function __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self, lexer, parser, parent):
                Token.__init__(self, 'FunctionCall', lexer, parser, parent)
                self.funcname = None
                self.arguments = []
        
        
        Severity: Minor
        Found in Exscript/interpreter/functioncall.py - About 45 mins 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 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self,
        Severity: Minor
        Found in Exscript/util/mail.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if search_window_len > search_window_size:
                                      clean_sw_size -= search_window_size
                                  break
          Severity: Major
          Found in Exscript/protocols/telnetlib.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if not self.send_data is None:
                                            self.send_data.write(data)
                                        channel.send(data.encode(self.encoding))
            Severity: Major
            Found in Exscript/protocols/protocol.py - About 45 mins to fix

              Function acquire_account has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def acquire_account(self, account=None, owner=None):
                      """
                      Acquires the given account. If no account is given, one is chosen
                      from the default pool.
              
              
              Severity: Minor
              Found in Exscript/account.py - About 45 mins 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 skip has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def skip(app, what, name, obj, skip, options):
              Severity: Minor
              Found in doc/conf.py - About 45 mins to fix

                Function _paramiko_connect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _paramiko_connect(self):
                        # Find supported address families.
                        addrinfo = socket.getaddrinfo(self.host, self.port)
                        for family, socktype, proto, canonname, sockaddr in addrinfo:
                            af = family
                Severity: Minor
                Found in Exscript/protocols/ssh2.py - About 45 mins 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 decorated has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        def decorated(job, host, conn, *args, **kwargs):
                Severity: Minor
                Found in Exscript/util/decorator.py - About 35 mins to fix

                  Function priority_enqueue has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def priority_enqueue(self,
                  Severity: Minor
                  Found in Exscript/workqueue/workqueue.py - About 35 mins to fix

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

                        def __init__(self,
                    Severity: Minor
                    Found in Exscript/emulators/vdevice.py - About 35 mins to fix

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

                          def __init__(self,
                      Severity: Minor
                      Found in Exscript/account.py - About 35 mins to fix

                        Function priority_enqueue_or_raise has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def priority_enqueue_or_raise(self,
                        Severity: Minor
                        Found in Exscript/workqueue/mainloop.py - About 35 mins to fix

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

                              def __init__(self, lexer, parser, parent, *args, **kwargs):
                          Severity: Minor
                          Found in Exscript/interpreter/template.py - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language