thekuwayama/tttls1.3

View on GitHub

Showing 84 of 95 total issues

Method deserialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def self.deserialize(binary)
        raise Error::ErrorAlerts, :internal_error if binary.nil?
        raise Error::ErrorAlerts, :decode_error if binary.length < 5
        raise Error::ErrorAlerts, :internal_error \
          unless binary[0] == HandshakeType::CERTIFICATE
Severity: Minor
Found in lib/tttls1.3/message/certificate.rb - 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

Method deserialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def self.deserialize(binary)
        raise Error::ErrorAlerts, :internal_error if binary.nil?
        raise Error::ErrorAlerts, :decode_error unless binary.length == 4
        raise Error::ErrorAlerts, :unexpected_message \
          unless binary[0] == HandshakeType::END_OF_EARLY_DATA
Severity: Minor
Found in lib/tttls1.3/message/end_of_early_data.rb - 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

Method deserialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def self.deserialize(binary)
        raise Error::ErrorAlerts, :internal_error if binary.nil?
        raise Error::ErrorAlerts, :decode_error if binary.length < 39
        raise Error::ErrorAlerts, :internal_error \
          unless binary[0] == HandshakeType::CLIENT_HELLO
Severity: Minor
Found in lib/tttls1.3/message/client_hello.rb - 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

Method deserialize_supported_signature_algorithms has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def self.deserialize_supported_signature_algorithms(binary)
          raise Error::ErrorAlerts, :internal_error if binary.nil?

          return nil if binary.length < 2

Severity: Minor
Found in lib/tttls1.3/message/extension/signature_algorithms.rb - 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

Method deserialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def self.deserialize(binary, msg_type)
          raise Error::ErrorAlerts, :internal_error if binary.nil?

          case msg_type
          when HandshakeType::CLIENT_HELLO
Severity: Minor
Found in lib/tttls1.3/message/extension/pre_shared_key.rb - 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

Method deserialize_keyshare_ch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def deserialize_keyshare_ch(binary)
            raise Error::ErrorAlerts, :internal_error if binary.nil?

            return nil if binary.length < 2

Severity: Minor
Found in lib/tttls1.3/message/extension/key_share.rb - 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

Method deserialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def self.deserialize(binary)
        raise Error::ErrorAlerts, :internal_error if binary.nil?
        raise Error::ErrorAlerts, :decode_error if binary.length < 13
        raise Error::ErrorAlerts, :internal_error \
          unless binary[0] == HandshakeType::NEW_SESSION_TICKET
Severity: Minor
Found in lib/tttls1.3/message/new_session_ticket.rb - 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

Method deserialize_request_ids has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def deserialize_request_ids(binary)
            raise Error::ErrorAlerts, :internal_error if binary.nil?

            i = 0
            request_ids = []
Severity: Minor
Found in lib/tttls1.3/message/extension/status_request.rb - 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

Method deserialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def self.deserialize(binary)
        raise Error::ErrorAlerts, :internal_error if binary.nil?
        raise Error::ErrorAlerts, :decode_error if binary.length < 8
        raise Error::ErrorAlerts, :internal_error \
          unless binary[0] == HandshakeType::CERTIFICATE_VERIFY
Severity: Minor
Found in lib/tttls1.3/message/certificate_verify.rb - 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

Method deserialize_versions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def self.deserialize_versions(binary)
          raise Error::ErrorAlerts, :internal_error if binary.nil?

          return nil if binary.empty?

Severity: Minor
Found in lib/tttls1.3/message/extension/supported_versions.rb - 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 method.
Open

      return false if @settings[:check_certificate_status] &&
Severity: Major
Found in lib/tttls1.3/client.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

              return nil unless i == binary.length
    Severity: Major
    Found in lib/tttls1.3/message/extension/pre_shared_key.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return false if !@settings[:ech_config].nil? && ehcs.empty?
      Severity: Major
      Found in lib/tttls1.3/client.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

              return false \
        Severity: Major
        Found in lib/tttls1.3/client.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return nil if pbe_len < 32
          Severity: Major
          Found in lib/tttls1.3/message/extension/pre_shared_key.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return false if !rsl.nil? && (rsl < 64 || rsl > 2**14 + 1)
            Severity: Major
            Found in lib/tttls1.3/client.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                        return nil unless i == binary.length
              Severity: Major
              Found in lib/tttls1.3/message/extension/status_request.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return nil if i > binary.length
                Severity: Major
                Found in lib/tttls1.3/message/extension/pre_shared_key.rb - About 30 mins to fix

                  Method deserialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def self.deserialize(binary, msg_type)
                            raise Error::ErrorAlerts, :internal_error if binary.nil?
                  
                            versions = []
                            case msg_type
                  Severity: Minor
                  Found in lib/tttls1.3/message/extension/supported_versions.rb - About 25 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

                  Method deserialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def self.deserialize(binary)
                          raise Error::ErrorAlerts, :internal_error if binary.nil?
                          raise Error::ErrorAlerts, :decode_error if binary.length < 4
                          raise Error::ErrorAlerts, :internal_error \
                            unless binary[0] == HandshakeType::FINISHED
                  Severity: Minor
                  Found in lib/tttls1.3/message/finished.rb - About 25 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