Showing 70 of 77 total issues
Method flush_left
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def flush_left( text )
indt = 0
if text =~ /^ /
while text !~ /^ {#{indt}}\S/
indt += 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"
Further reading
Method rootdir
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.rootdir
env = ENV['INLINEDIR'] || ENV['HOME']
# in case both INLINEDIR and HOME aren't defined, and under Windows
# default to HOMEDRIVE + HOMEPATH values
- 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 inline_textile_span
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def inline_textile_span( text )
QTAGS.each do |qtag_rc, ht, qtag_re, rtype|
text.gsub!( qtag_re ) do |m|
case rtype
- 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 inline
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def inline(lang = :C, options={})
case options
when TrueClass, FalseClass then
warn "WAR\NING: 2nd argument to inline is now a hash, changing to {:testing=>#{options}}" unless options
options = { :testing => options }
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(pattern = nil, conv = nil,
short = nil, long = nil, arg = nil,
desc = ([] if short or long), block = Proc.new)
Avoid deeply nested control flow statements. Open
rescue InvalidOption
# if no short options match, try completion with long
# options.
sw, = complete(:long, opt)
eq ||= !rest
Avoid deeply nested control flow statements. Open
if esc = scan(/ #{patterns::ESCAPE} /ox)
tokens << [match + esc, :char]
else
tokens << [match, :error]
end
Avoid deeply nested control flow statements. Open
if heredocs
unscan # heredoc scanning needs \n at start
state = heredocs.shift
tokens << [:open, state.type]
heredocs = nil if heredocs.empty?
Avoid deeply nested control flow statements. Open
if match == "\n"
value_expected = true # FIXME not quite true
state = :initial if state == :undef_comma_expected
end
Avoid deeply nested control flow statements. Open
elsif match = scan(/\#.*/) or
( bol? and match = scan(/#{patterns::RUBYDOC_OR_DATA}/o) )
kind = :comment
value_expected = true
tokens << [match, kind]
Avoid deeply nested control flow statements. Open
tokens << [modifiers, :modifier] unless modifiers.empty?
Avoid deeply nested control flow statements. Open
case m = getch
when state.delim, '\\'
tokens << [match + m, :char]
when nil
tokens << [match, :error]
Avoid deeply nested control flow statements. Open
if state.paren_depth > 0
tokens << [match, :nesting_delimiter]
next
end
Avoid deeply nested control flow statements. Open
htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
Method complete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def complete(id, opt, icase = false, *pat, &block)
Method update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update(sw, sopts, lopts, nsw = nil, nlopts = nil)
Method textile_fn_
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def textile_fn_( tag, num, atts, cite, content )
Method summarize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent, &blk)
Method summarize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def summarize(sdone = [], ldone = [], width = 1, max = width - 1, indent = "")
Method track_visibility
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def track_visibility(children:, visibility:, names:)
return unless VISIBILITY_MODIFIERS.include? visibility
if names.any?
children.each do |child|
- 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"