smok-serwis/coolamqp

View on GitHub

Showing 73 of 449 total issues

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

    def method_and_watch(self, method_payload,      # type: coolamqp.framing.base.AMQPMethodPayload,
Severity: Minor
Found in coolamqp/attaches/channeler.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if opt[0] > tag:
                                break  # We went too far, but it's OK, we don't need to bother with adjusting stop
                        else:
    Severity: Major
    Found in coolamqp/attaches/utils.py - About 45 mins to fix

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

          def publish(self, message, exchange=b'', routing_key=b'', span=None):
      Severity: Minor
      Found in coolamqp/attaches/publisher.py - About 35 mins to fix

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

            def __init__(self, declarer, queue, fut, span_parent=None, span_enqueued=None):
        Severity: Minor
        Found in coolamqp/attaches/declarer.py - About 35 mins to fix

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

              def __init__(self, channel, class_id, weight, body_size, properties):
          Severity: Minor
          Found in coolamqp/framing/frames.py - About 35 mins to fix

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

                def __init__(self, declarer, obj, fut=None, span_parent=None, span_enqueued=None):
            Severity: Minor
            Found in coolamqp/attaches/declarer.py - About 35 mins to fix

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

                  def __init__(self, sock, on_read=lambda data: None,
              Severity: Minor
              Found in coolamqp/uplink/listener/socket.py - About 35 mins to fix

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

                    def on_close(self, payload=None):
                        # type (tp.Optional[coolamqp.framing.base.AMQPMethodPayload) -> None
                        """
                        [EXTEND ME] Handler for channeler destruction.
                
                
                Severity: Minor
                Found in coolamqp/attaches/channeler.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 add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def add(self, attache):
                        """
                        Add an attache to this group.
                
                        If this is attached, and connection is ST_ONLINE, .attach() will be called
                Severity: Minor
                Found in coolamqp/attaches/agroup.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 drain has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def drain(self, timeout, span=None, dont_trace=False):  # type: (float) -> Event
                        """
                        Return an Event.
                
                        :param timeout: time to wait for an event. 0 means return immediately. None means block forever
                Severity: Minor
                Found in coolamqp/clustering/cluster.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

                Avoid too many return statements within this function.
                Open

                                return self.close_socket(sock_ex)
                Severity: Major
                Found in coolamqp/uplink/listener/select_listener.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return EpollListener
                  Severity: Major
                  Found in coolamqp/uplink/listener/thread.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return False
                    Severity: Major
                    Found in coolamqp/uplink/connection/recv_framer.py - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language