Showing 8 of 8 total issues
Method f_word_not_start_end
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f_word_not_start_end(str, b, e, i, j)
Method f_word_at_start
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def f_word_at_start(str, b, e, i, j)
Method flatten
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def flatten
# strip & remove the space surrounding '/'
str = strip.gsub(%r{\s*\/\s*}, '/')
return str unless str.include? '/'
return f_semicolon(str) if str.include?(';')
- 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 f_alternative_loop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def f_alternative_loop(str, h)
while h[:i] < str.length && !h[:quit]
case str[h[:i]]
# valid char in a word
when /[[:alnum:]\-']/ then f_update_start_end(h)
- 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 get_irregular
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_irregular(html)
return unless senses.any? { |s| s.part_of_speech.include? 'verb' }
present, sp, pp = explicit_irregular(html)
if sp.nil? || sp.empty?
node = html.css('.pos-header .inf') # arise
- 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 matched_word?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def matched_word?(word, node)
li = node.css('.base')
return false if li.empty?
resword = li.size == 1 ? li.text : li[0].text
if resword.include?('/') || resword.include?(';')
- 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 f_combine
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def f_combine(str, b, e, j)
(0..j).map do |i|
if f_alter_not_start_end?(str, b, e, j)
f_word_not_start_end(str, b, e, i, j)
elsif f_alter_at_end?(str, b, e, j)
- 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 phrase_css
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def phrase_css(html, selector)
phbs = html.css('.phrase-block')
phbs.each do |phb|
nodes = phb.css('.phrase, .v[title="Variant form"]')
nodes.each do |n|
- 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"