Class Zeta
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Zeta
module Instance
attr_reader :config
def initialize(options = {})
Method config
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def config
@lock.synchronize do
return @config if @config
full_config = YAML.load_file(config_file).with_indifferent_access
env_config = full_config[env]
- 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 clear_cache
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def clear_cache
@lock.synchronize do
# I'm afraid of FileUtils.rm_rf so I'll just delete all relevant files
# and then rmdir all empty directories.
Dir[File.join(cache_dir, "**/*.mson")].each{|f| FileUtils.rm(f) }
- 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 env
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def env
return @options[:env].to_sym if @options[:env]
if Object.const_defined?('Rails')
Rails.env.to_sym
else
- 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 update_own_contracts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_own_contracts
@lock.synchronize do
contract_files.each do |file|
source_file = File.join(config[:contracts_path], file)
target_file = File.join(cache_dir, config[:service_name], file)
- 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"