smok-serwis/coolamqp

View on GitHub

Showing 73 of 449 total issues

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

    def __init__(self, body,  # type: tp.Union[str, bytes, bytearray, tp.List[memoryview]]
Severity: Major
Found in coolamqp/objects.py - About 1 hr to fix

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

        def __init__(self, nodes,  # type: tp.Union[NodeDefinition, tp.List[NodeDefinition]]
    Severity: Major
    Found in coolamqp/clustering/cluster.py - About 1 hr to fix

      Function get_counter has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def get_counter(fields, prefix=u'', indent_level=2):
          """
          Emit code that counts how long this struct is.
      
          :param fields: list of Field instances
      Severity: Minor
      Found in coolamqp/framing/compilation/textcode_fields.py - About 1 hr 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 _callback has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def _callback(self, payload):
              assert not self.done
              self.done = True
              if isinstance(payload, ChannelClose):
                  err = AMQPError(payload)
      Severity: Minor
      Found in coolamqp/attaches/declarer.py - About 1 hr 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 alert_watches has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def alert_watches(watches, trigger):
          """
          Notify all watches in this collection.
      
          Return a list of alive watches.
      Severity: Minor
      Found in coolamqp/uplink/connection/connection.py - About 1 hr 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 a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, *args, **kwargs):
              self.heartbeat = kwargs.pop('heartbeat', None)
              self.port = kwargs.pop('port', 5672)
      
              if len(kwargs) > 0:
      Severity: Minor
      Found in coolamqp/objects.py - About 1 hr 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 _compile_particular_content_property_list_class has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def _compile_particular_content_property_list_class(zpf, fields):
          """
          Compile a particular content property list.
      
          Particularity stems from
      Severity: Minor
      Found in coolamqp/framing/compilation/content_property.py - About 1 hr to fix

        Function publish has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def publish(self, message, exchange=b'', routing_key=b'', span=None):
                """
                Schedule to have a message published.
        
                If mode is MODE_CNPUB:
        Severity: Minor
        Found in coolamqp/attaches/publisher.py - About 1 hr 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_frame has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def on_frame(self, frame):
                """
                Called by event loop upon receiving an AMQP frame.
        
                This will verify all watches on given channel if they were hit,
        Severity: Minor
        Found in coolamqp/uplink/connection/connection.py - About 1 hr 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 a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self, nodes,  # type: tp.Union[NodeDefinition, tp.List[NodeDefinition]]
                         on_fail=None,  # type: tp.Optional[tp.Callable[[], None]]
                         extra_properties=None,
                         # type: tp.Optional[tp.List[tp.Tuple[bytes, tp.Tuple[bytes, str]]]]
                         log_frames=None,
        Severity: Minor
        Found in coolamqp/clustering/cluster.py - About 1 hr 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 start has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def start(self, timeout=None):  # type: (tp.Optional[float]) -> None
                """
                Start processing events for this connect. Create the socket,
                transmit 'AMQP\x00\x00\x09\x01' and roll.
        
        
        Severity: Minor
        Found in coolamqp/uplink/connection/connection.py - About 1 hr 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 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, node_def,  # type: coolamqp.objects.NodeDefinition
        Severity: Major
        Found in coolamqp/clustering/single.py - About 1 hr to fix

          Function on_setup has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_setup(self, payload):
          
                  # Assert that mode is OK
                  if self.mode == Publisher.MODE_CNPUB:
                      if PUBLISHER_CONFIRMS not in self.connection.extensions:
          Severity: Minor
          Found in coolamqp/attaches/publisher.py - About 1 hr 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_connection_start has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_connection_start(self, payload  # type: coolamqp.framing.base.AMQPPayload
                                      ):
          
                  sasl_mechanisms = payload.mechanisms.tobytes().split(b' ')
                  locale_supported = payload.locales.tobytes().split(b' ')
          Severity: Minor
          Found in coolamqp/uplink/handshake.py - About 1 hr 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 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, name=b'',  # type: tp.Union[str, bytes]
          Severity: Major
          Found in coolamqp/objects.py - About 1 hr to fix

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

                def on_close(self, payload=None):
            
                    # we are interested in ChannelClose during order execution,
                    # because that means that operation was illegal, and must
                    # be discarded/exceptioned on future
            Severity: Minor
            Found in coolamqp/attaches/declarer.py - About 1 hr 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 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, queue, on_message, span=None,
            Severity: Major
            Found in coolamqp/attaches/consumer.py - About 1 hr to fix

              Function cancel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def cancel(self):  # type: () -> Future
                      """
                      Cancel the customer.
              
                      .ack() or .nack() for messages from this customer will have no effect.
              Severity: Minor
              Found in coolamqp/attaches/consumer.py - About 1 hr 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 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, name=u'',  # type: tp.Union[str, bytes]
              Severity: Major
              Found in coolamqp/objects.py - About 1 hr to fix

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

                    def __init__(self, connection,  # type: coolamqp.uplink.connection.Connection
                Severity: Major
                Found in coolamqp/uplink/handshake.py - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language