Showing 372 of 392 total issues
Method find_body
has 52 lines of code (exceeds 25 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]
File to_html.rb
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'cgi/util'
##
# Outputs RDoc markup as HTML.
Method parse_method_or_yield_parameters
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_method_or_yield_parameters(method = nil,
modifiers = RDoc::METHOD_MODIFIERS)
skip_tkspace_without_nl
tk = get_tk
end_token = get_end_token tk
Method parse_constant
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_constant container, tk, comment, ignore_constants = false
line_no = tk[:line_no]
name = tk[:text]
skip_tkspace_without_nl
Method to_html
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.to_html token_stream
starting_title = false
token_stream.map do |t|
next unless t
Method generate_file_files
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_file_files
setup
page_file = @template_dir + 'page.rhtml'
fileinfo_file = @template_dir + 'fileinfo.rhtml'
Method get_squashed_tk
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_squashed_tk
if @buf.empty?
tk = @tokens.shift
else
tk = @buf.shift
Method handle_method
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_method(type, var_name, meth_name, function, param_count,
source_file = nil)
class_name = @known_classes[var_name]
singleton = @singleton_classes.key? var_name
Method parse
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse parent, indent = 0
p :parse_start => indent if @debug
until @tokens.empty? do
type, data, column, = get
Method get_class_or_module
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_class_or_module container, ignore_constants = false
skip_tkspace
name_t = get_tk
given_name = ''.dup
- 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 document
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def document options
self.store = RDoc::Store.new
if RDoc::Options === options then
@options = options
- 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_string_tk
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private def get_string_tk(tk)
string = tk[:text]
state = nil
kind = :on_tstring
loop 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 complete
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def complete min_visibility
fix_basic_object_inheritance
# cache included modules before they are removed from the documentation
all_classes_and_modules.each { |cm| cm.ancestors }
- 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_symbol_arg_space
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def parse_symbol_arg_space no, tk # :nodoc:
args = []
unget_tk tk
if tk = parse_symbol_in_arg
- 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 save_class
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def save_class klass
full_name = klass.full_name
FileUtils.mkdir_p class_path(full_name) unless @dry_run
- 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 15 (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 save_class
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save_class klass
full_name = klass.full_name
FileUtils.mkdir_p class_path(full_name) unless @dry_run
Method parse_constant_body
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_constant_body container, constant, is_array_or_hash # :nodoc:
nest = 0
rhs_name = ''.dup
get_tkread
Method get_class_or_module
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_class_or_module container, ignore_constants = false
skip_tkspace
name_t = get_tk
given_name = ''.dup
Method read_file
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.read_file filename, encoding, force_transcode = false
content = File.open filename, "rb" do |f| f.read end
content.gsub!("\r\n", "\n") if RUBY_PLATFORM =~ /mswin|mingw/
utf8 = content.sub!(/\A\xef\xbb\xbf/, '')