Showing 5 of 19 total issues
Method compile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def compile
status "Building #{site.root_path.expand_path} to #{root_path.expand_path}"
resources.each do |resource, path|
if resource.renderable?
status "Rendering #{path}"
- 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 resolve_layout
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def resolve_layout
return resource.data.fetch("layout") if resource.data.key? "layout"
return layout unless has_layout_conditions?
clause, formats = layout_conditions.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"
Further reading
Method request_filename
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def request_filename
if node.root? and node.default_format == format
""
elsif node.root? and format
"#{node.default_name}.#{format}"
- 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 parse_basename
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_basename
base = basename
filename, extname = split_filename(base)
# This is a root path, so we have to treat it a little differently
- 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 controller_layout
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def controller_layout
private_layout_method = self.method(:_layout)
layout =
if Rails.version >= "6"
private_layout_method.call lookup_context, current_resource_rails_formats
- 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"