thekuwayama/tttls1.3

View on GitHub

Showing 84 of 95 total issues

Method softfail_check_certificate_status has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def self.softfail_check_certificate_status(res, cert, chain)
      ocsp_response = res
      cid = OpenSSL::OCSP::CertificateId.new(cert, chain.first)

      # When NOT received OCSPResponse in TLS handshake, this method will
Severity: Minor
Found in lib/tttls1.3/client.rb - About 55 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 initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def initialize(socket, **settings)
      @connection = Connection.new(socket, :server)
      @settings = DEFAULT_SERVER_SETTINGS.merge(settings)
      logger.level = @settings[:loglevel]

Severity: Minor
Found in lib/tttls1.3/server.rb - About 55 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 9 (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::SERVER_HELLO
Severity: Minor
Found in lib/tttls1.3/message/server_hello.rb - About 55 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 gen_certificate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def gen_certificate(crt, ch, chain = [], ocsp_response = nil)
      exs = Message::Extensions.new
      # status_request
      exs << Message::Extension::OCSPResponse.new(ocsp_response) \
        unless ocsp_response.nil?
Severity: Minor
Found in lib/tttls1.3/server.rb - About 55 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 8 (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, HandshakeType::ENCRYPTED_EXTENSIONS
Severity: Minor
Found in lib/tttls1.3/message/extension/early_data_indication.rb - About 45 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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def initialize(msg_type:, key_share_entry: [])
          @extension_type = ExtensionType::KEY_SHARE
          @msg_type = msg_type
          @key_share_entry = key_share_entry || []
          raise Error::ErrorAlerts, :internal_error \
Severity: Minor
Found in lib/tttls1.3/message/extension/key_share.rb - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
Open

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

          return nil if binary.length < 2

Severity: Minor
Found in lib/tttls1.3/message/extension/supported_groups.rb - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
Open

        def self.deserialize(binary)
          raise Error::ErrorAlerts, :internal_error if binary.nil?
          return nil if binary.length < 5 ||
                        binary[0] != CertificateStatusType::OCSP

Severity: Minor
Found in lib/tttls1.3/message/extension/status_request.rb - About 45 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 messages_type has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def messages_type
        types = @messages.map do |m|
          if [Message::ClientHello,
              Message::ServerHello,
              Message::EncryptedExtensions,
Severity: Minor
Found in lib/tttls1.3/message/record.rb - About 45 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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def initialize(msg_type:, versions: DEFAULT_VERSIONS)
          @extension_type = ExtensionType::SUPPORTED_VERSIONS
          @msg_type = msg_type
          @versions = versions || []
          case @msg_type
Severity: Minor
Found in lib/tttls1.3/message/extension/supported_versions.rb - About 45 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_certificate_list has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

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

          i = 0
          certificate_list = []
Severity: Minor
Found in lib/tttls1.3/message/certificate.rb - About 45 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 new_ch_outer_aad has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def self.new_ch_outer_aad(inner,
                              cipher_suite,
                              config_id,
                              enc,
                              payload_len,
Severity: Minor
Found in lib/tttls1.3/ech.rb - About 45 mins to fix

    Method deserialize_extension has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

            def deserialize_extension(binary, extension_type, msg_type)
              raise Error::ErrorAlerts, :internal_error if binary.nil?
    
              case extension_type
              when ExtensionType::SERVER_NAME
    Severity: Minor
    Found in lib/tttls1.3/message/extensions.rb - About 45 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 exporter has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def self.exporter(label, context, key_length, exporter_secret, cipher_suite)
    Severity: Minor
    Found in lib/tttls1.3/endpoint.rb - About 35 mins to fix

      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def initialize(maximum_name_length,
                         config_id,
                         cipher_suite,
                         public_name,
                         ctx)
      Severity: Minor
      Found in lib/tttls1.3/ech.rb - About 35 mins to fix

        Method new_ch_outer has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def self.new_ch_outer(aad, cipher_suite, config_id, enc, payload)
        Severity: Minor
        Found in lib/tttls1.3/ech.rb - About 35 mins to fix

          Method send_new_client_hello has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def send_new_client_hello(ch1,
                                        hrr,
                                        extensions,
                                        binder_key = nil,
                                        ech_state = nil)
          Severity: Minor
          Found in lib/tttls1.3/client.rb - About 35 mins to fix

            Method do_exporter has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def do_exporter(secret, digest, label, context, key_length)
            Severity: Minor
            Found in lib/tttls1.3/endpoint.rb - About 35 mins to fix

              Method hkdf_expand_label has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def self.hkdf_expand_label(secret, label, context, length, digest)
              Severity: Minor
              Found in lib/tttls1.3/key_schedule.rb - About 35 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language