onddo/ssl_certificate-cookbook

View on GitHub

Showing 10 of 10 total issues

Class SslCertificate has 40 methods (exceeds 20 allowed). Consider refactoring.
Open

    class SslCertificate < Chef::Resource
      # ssl_certificate Chef Resource cert related methods.
      module Cert
        # Resource certificate attributes to be initialized by a
        # `default_#{attribute}` method.
Severity: Minor
Found in libraries/resource_ssl_certificate_cert.rb - About 5 hrs to fix

    Class SslCertificate has 30 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class SslCertificate < Chef::Resource
          # ssl_certificate Chef Resource cert related methods.
          module Chain
            # Resource certificate attributes to be initialized by a
            # `default_#{attribute}` method.
    Severity: Minor
    Found in libraries/resource_ssl_certificate_chain.rb - About 3 hrs to fix

      Class SslCertificate has 30 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class SslCertificate < Chef::Resource
            # ssl_certificate Chef Resource key related methods.
            module Key
              # Resource key attributes to be initialized by a `default_#{attribute}`
              # method.
      Severity: Minor
      Found in libraries/resource_ssl_certificate_key.rb - About 3 hrs to fix

        Class SslCertificate has 22 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class SslCertificate < Chef::Resource
              # ssl_certificate Chef Resource cert generator helpers.
              module Generators
                def generate_key(length = 2048)
                  OpenSSL::PKey::RSA.new(length).to_pem
        Severity: Minor
        Found in libraries/resource_ssl_certificate_generators.rb - About 2 hrs to fix

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

                def load
                  key = read_from_path(key_path)
                  key_content(key) unless key.nil?
                  cert = read_from_path(cert_path)
                  cert_content(cert) unless cert.nil?
          Severity: Minor
          Found in libraries/resource_ssl_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 verify_self_signed_cert has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def verify_self_signed_cert(key, cert, _hostname,
                                              ca_cert_content = nil, pass_phrase = nil)
          Severity: Minor
          Found in libraries/resource_ssl_certificate_generators.rb - About 35 mins to fix

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

                    def generate_self_signed_cert_with_ca(key, cert, subject, ca_cert_cont,
                                                          ca_key_cont)
            Severity: Minor
            Found in libraries/resource_ssl_certificate_generators.rb - About 35 mins to fix

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

                        key_content, cert_subject, time, ca_cert_content, ca_key_content
              Severity: Minor
              Found in libraries/resource_ssl_certificate_cert.rb - About 35 mins to fix

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

                        def read_from_data_bag(bag, item, key, encrypt = false, secret = nil)
                Severity: Minor
                Found in libraries/resource_ssl_certificate_readers.rb - About 35 mins to fix

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

                          def generate_cert(key, subject, time, ca_cert_content = nil,
                                            ca_key_content = nil)
                  Severity: Minor
                  Found in libraries/resource_ssl_certificate_generators.rb - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language