Showing 388 of 406 total issues
Method load_all
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def load_all
load_cache
module_names.each do |module_name|
mod = find_class_or_module(module_name) || load_class(module_name)
- 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_classes_and_modules
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def do_classes_and_modules
do_boot_defclass if @file_name == "class.c"
@content.scan(
%r(
- 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 parse_method_params_and_body
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def parse_method_params_and_body container, single, meth, added_container
token_listener meth do
parse_method_parameters meth
if meth.document_self or not @track_visibility then
- 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_c_enclosure
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def find_c_enclosure variable
@c_enclosure_classes.fetch variable do
break unless name = @c_enclosure_names[variable]
mod = find_class_or_module name
- 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 complete_klass
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def complete_klass name, klass, selector, method, completions # :nodoc:
klasses = classes.keys
# may need to include Foo when given Foo::
klass_name = method ? name : klass
- 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 parse
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def parse(&block)
paragraph = ''
paragraph_start_line = 0
line_no = 0
- 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 setup_pager
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def setup_pager
return if @use_stdout
pagers = [ENV['RI_PAGER'], ENV['PAGER'], 'pager', 'less', 'more']
- 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 skip_optional_do_after_expression
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def skip_optional_do_after_expression
skip_tkspace_without_nl
tk = get_tk
b_nest = 0
Method collect_first_comment
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def collect_first_comment
skip_tkspace
comment = ''.dup
comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
first_line = true
Method normalized_file_list
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def normalized_file_list(relative_files, force_doc = false,
exclude_pattern = nil)
file_list = {}
relative_files.each do |rel_file_name|
Method load_all
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_all
load_cache
module_names.each do |module_name|
mod = find_class_or_module(module_name) || load_class(module_name)
Method handle_constants
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_constants(type, var_name, const_name, definition)
class_name = @known_classes[var_name]
return unless class_name
Method parse_identifier
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_identifier container, single, tk, comment # :nodoc:
case tk[:text]
when 'private', 'protected', 'public', 'private_class_method',
'public_class_method', 'module_function' then
parse_visibility container, single, tk
Method generate_gzipped
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_gzipped
return if @options.dry_run or not defined?(Zlib)
debug_msg "Compressing generated JSON index"
out_dir = @base_dir + @options.op_dir
Method calculate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def calculate
return if @doc_items
ucm = @store.unique_classes_and_modules
Method setup_output_dir
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_output_dir(dir, force)
flag_file = output_flag_file dir
last = {}
Method scan
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def scan
reset
catch :eof do
begin
Method initialize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize path = nil, type = nil
@dry_run = false
@encoding = nil
@path = path
@rdoc = nil
Method get_method_container
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_method_container container, name_t # :nodoc:
prev_container = container
container = container.find_module_named(name_t[:text])
unless container then
Method parse_method_name_singleton
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_method_name_singleton container, name_t # :nodoc:
skip_tkspace
name_t2 = get_tk
if (:on_kw == name_t[:kind] && 'self' == name_t[:text]) || (:on_op == name_t[:kind] && '%' == name_t[:text]) then