knipknap/exscript

View on GitHub

Showing 153 of 245 total issues

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

def get_hosts_from_file(filename,
Severity: Minor
Found in Exscript/util/file.py - About 35 mins to fix

    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 _compile has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _compile(conn, filename, template, parser_kwargs, **kwargs):
      Severity: Minor
      Found in Exscript/util/template.py - About 35 mins to fix

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

            def priority_enqueue(self, function, name, force_start, times, data):
        Severity: Minor
        Found in Exscript/workqueue/mainloop.py - About 35 mins to fix

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

          def start(users, hosts, func, only_authenticate=False, **kwargs):
          Severity: Minor
          Found in Exscript/util/start.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/workqueue.py - About 35 mins to fix

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

              def _run(conn, filename, template, parser_kwargs, **kwargs):
              Severity: Minor
              Found in Exscript/util/template.py - About 35 mins to fix

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

                    def __init__(self, name, lexer, parser, parent=None):
                Severity: Minor
                Found in Exscript/parselib/token.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/iosemu.py - About 35 mins to fix

                    Function init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def init(self, *args, **kwargs):
                            for key in kwargs:
                                if key.find('.') >= 0 or key.startswith('_'):
                                    continue
                                if type(kwargs[key]) == type([]):
                    Severity: Minor
                    Found in Exscript/interpreter/program.py - About 35 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 otp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def otp(password, seed, sequence):
                        """
                        Calculates a one-time password hash using the given password, seed, and
                        sequence number and returns it.
                        Uses the MD4/sixword algorithm as supported by TACACS+ servers.
                    Severity: Minor
                    Found in Exscript/util/crypt.py - About 35 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 status has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def status(logger):
                        """
                        Creates a one-line summary on the actions that were logged by the given
                        Logger.
                    
                    
                    Severity: Minor
                    Found in Exscript/util/report.py - About 35 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 disconnect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def disconnect(self, callback):
                            """
                            Disconnects the signal from the given function.
                    
                            :type  callback: object
                    Severity: Minor
                    Found in Exscript/util/event.py - About 35 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 next_if has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def next_if(self, types, token=None):
                            if token is not None:
                                if self.current_is(types, token):
                                    next(self)
                                    return 1
                    Severity: Minor
                    Found in Exscript/parselib/lexer.py - About 35 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 _get_prompt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _get_prompt(self):
                            if self.prompt_stage == self.PROMPT_STAGE_USERNAME:
                                if self.login_type == self.LOGIN_TYPE_USERONLY:
                                    self.prompt_stage = self.PROMPT_STAGE_CUSTOM
                                else:
                    Severity: Minor
                    Found in Exscript/emulators/vdevice.py - About 35 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 _on_job_completed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _on_job_completed(self, job, exc_info):
                            # This function is called in a sub-thread, so we need to be
                            # careful that we are not in a lock while sending an event.
                            self._dbg(1, 'Job "%s" called completed()' % job.name)
                    
                    
                    Severity: Minor
                    Found in Exscript/workqueue/mainloop.py - About 35 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 _domatch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _domatch(self, prompt, flush):
                            # Wait for a prompt.
                            result, match, self.response = self._expect_any(prompt, flush)
                    
                            if match:
                    Severity: Minor
                    Found in Exscript/protocols/dummy.py - About 35 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 get_hosts_from_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def get_hosts_from_file(filename,
                                            default_protocol='telnet',
                                            default_domain='',
                                            remove_duplicates=False,
                                            encoding='utf-8'):
                    Severity: Minor
                    Found in Exscript/util/file.py - About 35 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 _recvline has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _recvline(self, conn):
                            while not b'\n' in self.buf:
                                r, w, x = select.select([conn], [], [], self.timeout)
                                if not self.running:
                                    return None
                    Severity: Minor
                    Found in Exscript/servers/telnetd.py - About 35 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 get_user has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def get_user(prompt=None):
                        """
                        Prompts the user for his login name, defaulting to the USER environment
                        variable. Returns a string containing the username.
                        May throw an exception if EOF is given by the user.
                    Severity: Minor
                    Found in Exscript/util/interact.py - About 35 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

                    Severity
                    Category
                    Status
                    Source
                    Language