Showing 406 of 406 total issues
Method check_modeline
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.check_modeline file_name
line = File.open file_name do |io|
io.gets
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 get_heredoc_tk
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private def get_heredoc_tk(heredoc_name, indent)
string = ''
start_tk = nil
prev_tk = nil
until heredoc_end?(heredoc_name, indent, tk = @tokens.shift) do
- 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 gemdirs
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.gemdirs filter = :latest
ri_paths = {}
all = Gem::Specification.map do |spec|
[File.join(spec.doc_dir, 'ri'), spec.name, spec.version]
- 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 define
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def define
desc rdoc_task_description
task rdoc_task_name
desc rerdoc_task_description
- 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 block_params=
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def block_params=(value)
# 'yield.to_s' or 'assert yield, msg'
return @block_params = '' if value =~ /^[\.,]/
# remove trailing 'if/unless ...'
- 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 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"