zebardy/rubygems_ssl-client-certs

View on GitHub

Showing 4 of 4 total issues

Method configure_connection_for_https has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def configure_connection_for_https(connection)
      require 'net/https'
      connection.use_ssl = true
      connection.verify_mode =
        Gem.configuration.ssl_verify_mode || OpenSSL::SSL::VERIFY_PEER
Severity: Minor
Found in lib/rubygems_plugin.rb - About 2 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

Method connection_for has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def connection_for(uri)
      net_http_args = [uri.host, uri.port]

      if @proxy_uri and not no_proxy?(uri.host) then
        net_http_args += [
Severity: Minor
Found in lib/rubygems_plugin.rb - About 2 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

Method configure_connection_for_https has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def configure_connection_for_https(connection)
      require 'net/https'
      connection.use_ssl = true
      connection.verify_mode =
        Gem.configuration.ssl_verify_mode || OpenSSL::SSL::VERIFY_PEER
Severity: Minor
Found in lib/rubygems_plugin.rb - About 1 hr to fix

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

      def set_ssl_vars
        @ssl_verify_mode = @hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
        @ssl_ca_cert = @hash[:ssl_ca_cert] if @hash.key? :ssl_ca_cert
        @ssl_ca_cert = ENV['BUNDLE_SSL_CA_CERT'] unless @ssl_ca_cert
        @ssl_client_cert = @hash[:ssl_client_cert] if @hash.key? :ssl_client_cert
    Severity: Minor
    Found in lib/rubygems_plugin.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