Showing 406 of 406 total issues
Method add_class
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_class class_type, given_name, superclass = '::Object'
# superclass +nil+ is passed by the C parser in the following cases:
# - registering Object in 1.8 (correct)
# - registering BasicObject in 1.9 (correct)
# - registering RubyVM in 1.9 in iseq.c (incorrect: < Object in vm.c)
Method get_method_container
has a Cognitive Complexity of 21 (exceeds 5 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
- 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 build_paragraph
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def build_paragraph margin
p :paragraph_start => margin if @debug
paragraph = RDoc::Markup::Paragraph.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"
Further reading
Method handle_directive
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_directive prefix, directive, param, code_object = nil,
encoding = nil, line = nil
blankline = "#{prefix.strip}\n"
directive = directive.downcase
Class CodeObject
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class RDoc::CodeObject
include RDoc::Text
##
Method get_included_module_with_optional_parens
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_included_module_with_optional_parens
skip_tkspace_without_nl
get_tkread
tk = get_tk
end_token = get_end_token tk
Method add_attribute
has a Cognitive Complexity of 20 (exceeds 5 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=()'
- 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 process_args
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def self.process_args argv
options = default_options
opts = OptionParser.new do |opt|
opt.program_name = File.basename $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 tokenize
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def tokenize input
setup_scanner input
until @s.eos? do
pos = @s.pos
- 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 build_verbatim
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_verbatim margin
p :verbatim_begin => margin if @debug
verbatim = RDoc::Markup::Verbatim.new
min_indent = nil
Class Options
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class RDoc::Options
##
# The deprecated options.
Method marshal_load
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def marshal_load array # :nodoc:
initialize_visibility
initialize_methods_etc
@current_section = nil
@document_self = true
Method find_symbol_module
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def find_symbol_module(symbol)
result = nil
# look for a class or module 'symbol'
case symbol
- 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 collect_first_comment
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def collect_first_comment
skip_tkspace
comment = ''.dup
comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
first_line = 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 find_body
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def find_body class_name, meth_name, meth_obj, file_content, quiet = false
if file_content
@body_table ||= {}
@body_table[file_content] ||= gen_body_table file_content
type, *args = @body_table[file_content][meth_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 prepare_comments
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def prepare_comments(comments)
current = []
consecutive_comments = [current]
@modifier_comments = {}
comments.each do |comment|
- 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 split_into_flow
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def split_into_flow
res = []
current_attr = 0
str_len = @str.length
- 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
File ripper_state_lex.rb
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ripper'
##
# Wrapper for Ripper lex states
Method build_list
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_list margin
p :list_start => margin if @debug
list = RDoc::Markup::List.new
label = nil
Method handle_meta_method_comment
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_meta_method_comment(comment, node)
is_call_node = node.is_a?(Prism::CallNode)
singleton_method = false
visibility = @visibility
attributes = rw = line_no = method_name = nil