Showing 3 of 3 total issues
Method __update_configuration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __update_configuration(key, new_value)
conf = config_file
replace = new_value.is_a?(String) ? "'#{new_value}'" : new_value
check = new_value.is_a?(String) ? Regexp.escape(replace) : replace
- 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 laravel_exists_in_directory?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def laravel_exists_in_directory?(directory = nil, relative_to = nil)
return false unless directory
directory = File.expand_path(directory, relative_to)
return false unless File.exists? File.join(directory, "artisan")
return false unless File.directory? File.join(directory, "laravel")
- 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 artisan
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def artisan(command, options = {})
raise LaravelNotFoundError unless laravel_exists_in_directory?(@path)
php = `which php`.strip
raise RequiredLibraryMissingError, "php" unless php
command = "#{php} #{@path}/artisan #{command}"
- 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"