Showing 27 of 201 total issues
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(site, base, autopage_config, pagination_config, layout_name, collection, collection_name)
Method autopage_create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def self.autopage_create(autopage_config, pagination_config, posts_to_use, configkey_name, indexkey_name, createpage_lambda )
Method read_config_value_and_filter_posts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def self.read_config_value_and_filter_posts(config, config_key, posts, source_posts, should_union = false)
Avoid too many return
statements within this method. Open
Open
return posts if config[config_key].nil?
Avoid too many return
statements within this method. Open
Open
return a <=> b
Avoid too many return
statements within this method. Open
Open
return posts
Method sort_values
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.sort_values(a, b)
if a.nil? && !b.nil?
return -1
elsif !a.nil? && b.nil?
return 1
- 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"