Showing 13 of 21 total issues
Method manipulate_resource_list
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def manipulate_resource_list(resources)
@_articles = []
used_resources = []
resources.each do |resource|
- 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 article
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def article
@content = options[:content] || ''
@date = options[:date] ? ::Time.zone.parse(options[:date]) : Time.zone.now
@locale = options[:locale] || (::I18n.default_locale if defined? ::I18n)
@slug = safe_parameterize(title)
- 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 manipulate_resource_list
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def manipulate_resource_list(resources)
new_resources = []
resources.each do |res|
next if res.ignored?
- 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 blog_controller
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def blog_controller(blog_name = nil)
if !blog_name && current_resource
blog_name = current_resource.metadata[:page][:blog]
unless blog_name
- 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 after_configuration
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def after_configuration
@name ||= begin
found_name = nil
app.extensions[:blog].values.each_with_index do |ext, i|
- 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 date
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def date
return @_date if @_date
frontmatter_date = data['date']
- 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 after_configuration
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def after_configuration
@name ||= begin
found_name = nil
app.extensions[:blog].values.each_with_index do |ext, i|
Method article
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def article
@content = options[:content] || ''
@date = options[:date] ? ::Time.zone.parse(options[:date]) : Time.zone.now
@locale = options[:locale] || (::I18n.default_locale if defined? ::I18n)
@slug = safe_parameterize(title)
Method manipulate_resource_list
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def manipulate_resource_list(resources)
@_articles = []
used_resources = []
resources.each do |resource|
Method manipulate_resource_list
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def manipulate_resource_list(resources)
new_resources = []
# Set up date pages if the appropriate templates have been specified
@blog_data.articles.group_by { |a| a.date.year }.each do |year, year_articles|
- 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 render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def render(opts = {}, locs = {}, &block)
unless opts.key?(:layout)
opts[:layout] = metadata[:options][:layout]
opts[:layout] = blog_options.layout if opts[:layout].nil? || opts[:layout] == :_auto_layout
- 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 initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(app, options_hash = {}, &block)
super
@custom_pages = {}
- 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 page_locals
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def page_locals(page_num, num_pages, per_page, prev_page_res, articles)