Showing 388 of 406 total issues
Method marshal_load
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def marshal_load array # :nodoc:
initialize_visibility
initialize_methods_etc
@current_section = nil
@document_self = 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 lookup_method
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def lookup_method name
found = load_methods_matching name
if found.empty?
if check_did_you_mean
- 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 root_search
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def root_search req, res
search_index = []
info = []
installed_docs.map do |name, href, exists, type, path|
Method parse_call_parameters
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_call_parameters(tk)
end_token = case tk[:kind]
when :on_lparen
:on_rparen
when :on_rparen
Method add_attribute
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_attribute attribute
return attribute unless @document_self
# mainly to check for redefinition of an attribute as a method
# TODO find a policy for 'attr_reader :foo' + 'def foo=()'
Method get_words_tk
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private def get_words_tk(tk)
string = ''
start_token = tk[:text]
start_quote = tk[:text].rstrip[-1]
line_no = tk[:line_no]
Method marshal_load
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def marshal_load array
initialize_visibility
@dont_rename_initialize = nil
@token_stream = nil
Method summary
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def summary
calculate
num_width = [@num_files, @num_items].max.to_s.length
undoc_width = [
Method parse_method
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_method(container, single, tk, comment)
singleton = nil
added_container = false
name = nil
column = tk[:char_no]
Method update_visibility
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_visibility container, vis_type, vis, singleton # :nodoc:
new_methods = []
case vis_type
when 'module_function' then
Method split_into_flow
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def split_into_flow
res = []
current_attr = 0
str_len = @str.length
Method report_class_module
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report_class_module cm
return if cm.fully_documented? and @coverage_level.zero?
return unless cm.display?
report = RDoc::Markup::Document.new
Method define
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def define
desc rdoc_task_description
task rdoc_task_name
desc rerdoc_task_description
Method add_method
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_method(name, receiver_name:, receiver_fallback_type:, visibility:, singleton:, params:, calls_super:, block_params:, tokens:, start_line:, end_line:)
receiver = receiver_name ? find_or_create_module_path(receiver_name, receiver_fallback_type) : @container
meth = RDoc::AnyMethod.new(nil, name)
if (comment = consecutive_comment(start_line))
handle_consecutive_comment_directive(@container, comment)
Method generate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def generate
return if @spec.default_gem?
return unless @generate_ri or @generate_rdoc
setup
- 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_class_regular
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def parse_class_regular container, declaration_context, single, # :nodoc:
name_t, given_name, comment
superclass = '::Object'
if given_name =~ /^::/ 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 print_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def print_file files_so_far, filename
progress_bar = sprintf("%3d%% [%2d/%2d] ",
100 * files_so_far / @num_files,
files_so_far,
@num_files)
- 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 load_variable_map
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def load_variable_map map_name
return {} unless files = @store.cache[map_name]
return {} unless name_map = files[@file_name]
class_map = {}
- 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 store_for
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def store_for source_name
case source_name
when 'home' then
RDoc::Store.new RDoc::RI::Paths.home_dir, :home
when 'ruby' 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 report_class_module
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def report_class_module cm
return if cm.fully_documented? and @coverage_level.zero?
return unless cm.display?
report = RDoc::Markup::Document.new
- 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"