Showing 9 of 126 total issues
Class API
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class API
# Router translates method arguments to rest-ful API request parameters.
# because of this, most of the methods suffer from :reek:LongParameterList:
# and :reek:UtilityFunction:
module Router
Method add_option
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def add_option name, options = {}, &def_proc
accepted_options << name
allow_env = options[:env].nil? || options[:env]
env_var = options[:env] || "CONJUR_#{name.to_s.upcase}"
def_val = options[:default]
- 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 memberships
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def memberships options = {}
request = if options.delete(:recursive) == false
options["memberships"] = true
else
options["all"] = true
- 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 add_option
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_option name, options = {}, &def_proc
accepted_options << name
allow_env = options[:env].nil? || options[:env]
env_var = options[:env] || "CONJUR_#{name.to_s.upcase}"
def_val = options[:default]
Method prefixlen
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def prefixlen
unless @prefixlen
return @prefixlen = 0 if (mask = mask_addr) == 0
@prefixlen = ipv4? ? 32 : 128
- 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 create_log
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.create_log param
if param
if param.is_a? String
if param == 'stdout'
Logger.new $stdout
- 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 authn_authenticate_local
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def authn_authenticate_local username, account, expiration, cidr, &block
Method add_chained_cert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_chained_cert store, chained_cert
parse_certs(chained_cert).each do |cert|
begin
store.add_cert cert
rescue OpenSSL::X509::StoreError => ex
- 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 resources
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def resources options = {}
options = { host: Conjur.configuration.core_url, credentials: credentials }.merge options
options[:account] ||= Conjur.configuration.account
host, credentials, account, kind = options.values_at(*[:host, :credentials, :account, :kind])
- 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"