Showing 23 of 23 total issues
Method file_browser_field
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def file_browser_field(name, options = {})
prompt = options.delete(:prompt) || "Select #{name.to_s.titleize}"
value = object.send(name)
options[:value] = File.basename(value) if value
- 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 as_json
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def as_json(options = nil)
return super if options
json = super(:except => [:job_id, :target, :output_log_file])
if json["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 ls
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ls(path, options = {})
roots = options[:root] ? Array(options[:root]) : root_directory
return roots if path.to_s.empty?
# Make sure path starts with one of the roots, checking the longest one first.
- 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"