Scripts/generate_ec_curved_keys.rb
Class KeysGenerator
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class KeysGenerator
module FileFormatsModule
def only_name(name)
# remove extension
Pathname.new(name).basename
File generate_ec_curved_keys.rb
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'optparse'
require 'shellwords'
require 'pathname'
class ShellExecutor
@@dry_run = false
Method generated
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def generated(type, parameters, private_key_pem, public_key_pem, certificate_request, certificate, p12, p12_password)
Method generated
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def generated(type, parameters, private_key_pem, public_key_pem, certificate_request, certificate, p12, p12_password)
the_private_key_pem ||= FileFormats.to_pem private_key_pem
the_public_key_pem ||= FileFormats.to_pem public_key_pem
the_certificate_request ||= FileFormats.to_certificate_request certificate_request
the_certificate ||= FileFormats.to_certificate certificate
- 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"