Showing 6 of 6 total issues
Method _simple_compress
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _simple_compress(nodes)
# dedup nodes
set = {}
nodes.each do |node|
set[node] = true
- 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 _sort_nodes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _sort_nodes(nodes)
sorted = nodes.map { |n|
# decorate-sort-undecorate
# FIXME can this all be pushed into sort_by?
n =~ /\A#{@@NodeRegx}\z/
- 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 _simple_compress
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _simple_compress(nodes)
# dedup nodes
set = {}
nodes.each do |node|
set[node] = true
Method compress
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def compress(nodes)
domain_tbl = {}
no_domain_list = []
nodes.each do |n|
# If this is a quoted range, just compress it without collapsing
Method compress
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def compress(nodes)
domain_tbl = {}
no_domain_list = []
nodes.each do |n|
# If this is a quoted range, just compress it without collapsing
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options = {})
@host = 'range'
@host = ENV['RANGE_HOST'] if ENV.has_key?('RANGE_HOST')
@host = options[:host] if options.member?(:host)
- 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"