Method installer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.installer(type, installer_opts = {}, &locator)
locator ||= lambda{|to| to}
loc_method = "install_location_for_#{type}".to_sym
define_method("simple_#{loc_method}", locator)
define_method(loc_method) do |to, options|
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def run(run_options = {})
prepare unless run_options[:skip_preparation]
install unless options[:prepare]
finalize(options.merge(run_options)) unless options[:prepare] || run_options[:skip_finalization]
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 install_html
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def install_html(from, to, options)
if to =~ /\.haml$/
require 'haml'
to = to[0..-(".haml".length+1)]
if respond_to?(:install_location_for_html)
- 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"