knipknap/exscript

View on GitHub

Showing 153 of 245 total issues

File protocol.py has 1036 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
Severity: Major
Found in Exscript/protocols/protocol.py - About 2 days to fix

    File telnetlib.py has 621 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #
    # Copyright (C) 2010-2017 Samuel Abels
    # The MIT License (MIT)
    #
    # Permission is hereby granted, free of charge, to any person obtaining
    Severity: Major
    Found in Exscript/protocols/telnetlib.py - About 1 day to fix

      File queue.py has 601 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #
      # Copyright (C) 2010-2017 Samuel Abels
      # The MIT License (MIT)
      #
      # Permission is hereby granted, free of charge, to any person obtaining
      Severity: Major
      Found in Exscript/queue.py - About 1 day to fix

        File account.py has 589 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #
        # Copyright (C) 2010-2017 Samuel Abels
        # The MIT License (MIT)
        #
        # Permission is hereby granted, free of charge, to any person obtaining
        Severity: Major
        Found in Exscript/account.py - About 1 day to fix

          Protocol has 60 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Protocol(object):
          
              """
              This is the base class for all protocols; it defines the common portions
              of the API.
          Severity: Major
          Found in Exscript/protocols/protocol.py - About 1 day to fix

            Function process_rawq has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
            Open

                def process_rawq(self):
                    """Transfer from raw queue to cooked queue.
            
                    Set self.eof when connection is closed.  Don't block unless in
                    the midst of an IAC sequence.
            Severity: Minor
            Found in Exscript/protocols/telnetlib.py - About 7 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 _waitfor has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

                def _waitfor(self, relist, timeout=None, flush=False, cleanup=None):
                    re = None
                    relist = relist[:]
                    indices = list(range(len(relist)))
                    search_window_size = 150
            Severity: Minor
            Found in Exscript/protocols/telnetlib.py - About 6 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 value has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

                def value(self, context):
                    # Special behavior where we only have one term.
                    if self.op is None:
                        return self.lft.value(context)
                    elif self.op == 'not':
            Severity: Minor
            Found in Exscript/interpreter/expression.py - About 6 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

            File mail.py has 374 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            #
            # Copyright (C) 2010-2017 Samuel Abels
            # The MIT License (MIT)
            #
            # Permission is hereby granted, free of charge, to any person obtaining
            Severity: Minor
            Found in Exscript/util/mail.py - About 5 hrs to fix

              Function _app_authenticate has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _app_authenticate(self,
                                        account,
                                        password,
                                        flush=True,
                                        bailout=False):
              Severity: Minor
              Found in Exscript/protocols/protocol.py - About 4 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

              File ssh2.py has 352 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              #
              # Copyright (C) 2010-2017 Samuel Abels
              # The MIT License (MIT)
              #
              # Permission is hereby granted, free of charge, to any person obtaining
              Severity: Minor
              Found in Exscript/protocols/ssh2.py - About 4 hrs to fix

                File crypt.py has 346 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                #
                # Copyright (C) 2010-2017 Samuel Abels
                # The MIT License (MIT)
                #
                # Permission is hereby granted, free of charge, to any person obtaining
                Severity: Minor
                Found in Exscript/util/crypt.py - About 4 hrs to fix

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

                      def __init__(self, lexer, parser, parent, *args, **kwargs):
                          Scope.__init__(self, 'Template', lexer, parser, parent, **kwargs)
                          lexer.set_grammar(grammar_c)
                          # print("Opening Scope:", lexer.token())
                          buffer = ''
                  Severity: Minor
                  Found in Exscript/interpreter/template.py - About 4 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 _open_posix_shell has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _open_posix_shell(self,
                                            channel,
                                            key_handlers,
                                            handle_window_size):
                          # We need to make sure to use an unbuffered stdin, else multi-byte
                  Severity: Minor
                  Found in Exscript/protocols/protocol.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

                  Queue has 31 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Queue(object):
                  
                      """
                      Manages hosts/tasks, accounts, connections, and threads.
                      """
                  Severity: Minor
                  Found in Exscript/queue.py - About 3 hrs to fix

                    File host.py has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    #
                    # Copyright (C) 2010-2017 Samuel Abels
                    # The MIT License (MIT)
                    #
                    # Permission is hereby granted, free of charge, to any person obtaining
                    Severity: Minor
                    Found in Exscript/host.py - About 3 hrs to fix

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

                          def __init__(self, lexer, parser, parent):
                              Scope.__init__(self, 'Code', lexer, parser, parent)
                              lexer.set_grammar(grammar_c)
                              while True:
                                  lexer.skip(['whitespace', 'newline'])
                      Severity: Minor
                      Found in Exscript/interpreter/code.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

                      Telnet has 28 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Telnet(object):
                      
                          """Telnet interface class.
                      
                          An instance of this class represents a connection to a telnet
                      Severity: Minor
                      Found in Exscript/protocols/telnetlib.py - About 3 hrs to fix

                        Pipeline has 28 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Pipeline(object):
                        
                            """
                            A collection that is similar to Python's Queue object, except
                            it also tracks items that are currently sleeping or in progress.
                        Severity: Minor
                        Found in Exscript/workqueue/pipeline.py - About 3 hrs to fix

                          SSH2 has 28 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class SSH2(Protocol):
                          
                              """
                              The secure shell protocol version 2 adapter, based on Paramiko.
                              """
                          Severity: Minor
                          Found in Exscript/protocols/ssh2.py - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language