Showing 10 of 10 total issues
Class SslCertificate
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
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.
Class SslCertificate
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
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.
Class SslCertificate
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
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.
Class SslCertificate
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
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
Method load
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
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?
- Read upRead up
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 generate_cert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def generate_cert(key, subject, time, ca_cert_content = nil,
ca_key_content = nil)
Method generate_cert_with_ca
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
key_content, cert_subject, time, ca_cert_content, ca_key_content
Method verify_self_signed_cert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def verify_self_signed_cert(key, cert, _hostname,
ca_cert_content = nil, pass_phrase = nil)
Method read_from_data_bag
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def read_from_data_bag(bag, item, key, encrypt = false, secret = nil)
Method generate_self_signed_cert_with_ca
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def generate_self_signed_cert_with_ca(key, cert, subject, ca_cert_cont,
ca_key_cont)