Showing 6 of 8 total issues
Method validate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.validate(path,data)
unless data.kind_of?(Hash)
raise(InvalidConfig,"config data must be a Hash: #{data.inspect}")
end
- 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 print_record
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def print_record(cert)
puts "[ #{cert.subject.common_name} ]"
puts
indent do
Method parse_uri
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse_uri(uri)
if (match = uri.match(/\Asqlite(?:3)?:(.+)\z/))
{
adapter: 'sqlite3',
database: normalize_sqlite3_path(match[1])
- 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 run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run(name=nil)
config = ConfigFile.load
if name
unless (hash = config[name.to_sym])
- 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 print_cert_org
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def print_cert_org(cert_org)
fields = {}
if cert_org.common_name
fields['Common Name (CN)'] = cert_org.common_name
- 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 import_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def import_file(path)
unless File.file?(path)
print_error "no such file or directory: #{path}"
exit(-1)
end
- 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"