Showing 387 of 405 total issues
Avoid deeply nested control flow statements. Open
line_no = tk[:line_no] if comment.empty?
Avoid deeply nested control flow statements. Open
comment << "\n" unless comment_body =~ /\n\z/
Avoid deeply nested control flow statements. Open
non_comment_seen = parse_comment container, tk, comment unless
comment.empty?
Avoid deeply nested control flow statements. Open
elsif :on_nl == tk[:kind] then
if nest <= 0 and RDoc::Parser::RipperStateLex.end?(tk) then
unget_tk tk
break
end
Avoid deeply nested control flow statements. Open
parse_comment container, tk, comment unless comment.empty?
Avoid deeply nested control flow statements. Open
comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
Avoid deeply nested control flow statements. Open
warn "Warning: yield outside of method" if container.document_self
Method load_cache
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_cache
#orig_enc = @encoding
@cache = marshal_load(cache_path)
- 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 do_methods
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def do_methods
@content.scan(%r%rb_define_
(
singleton_method |
method |
- 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 find_class_named_from
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_class_named_from name, from
from = find_class_named from unless RDoc::Context === from
until RDoc::TopLevel === from do
return nil unless from
- 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
Avoid deeply nested control flow statements. Open
if empty then
label << data
next if empty == :continue
break
end
Method handle_directive
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_directive prefix, directive, param, code_object = nil,
encoding = nil, line = nil
Method find_methods
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_methods name
klass, selector, method = parse_name name
types = method_type selector
- 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 finish
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def finish
if @write_options then
write_options
exit
end
- 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 tt_sections
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def tt_sections text
flow = @am.flow text.dup
flow.each do |item|
case item
- 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 display_attributes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def display_attributes
puts
puts @str.tr(NULL, "!")
bit = 1
16.times do |bno|
- 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
Avoid deeply nested control flow statements. Open
if peek_type.nil? || column < margin then
empty = true
elsif column == margin then
case peek_type
when type
Method run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run
if @list_doc_dirs then
puts @doc_dirs
elsif @list then
list_known_classes @names
- 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
Avoid deeply nested control flow statements. Open
while peek_type == :NEWLINE
get
peek_type, _, column, = peek_token
end
Method convert_regexp_handlings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def convert_regexp_handlings str, attrs, exclusive = false
@regexp_handlings.each do |regexp, attribute|
next unless exclusive == exclusive?(attribute)
str.scan(regexp) do
capture = $~.size == 1 ? 0 : 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"