File driver.rb
has 960 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'optparse'
require_relative '../../rdoc'
require_relative 'formatter' # For RubyGems backwards compatibility
Class Driver
has 60 methods (exceeds 20 allowed). Consider refactoring. Open
class RDoc::RI::Driver
##
# Base Driver error class
Method process_args
has 184 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.process_args argv
options = default_options
opts = OptionParser.new do |opt|
opt.accept File do |file,|
Method interactive
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def interactive
puts "\nEnter the method name you want to look up."
begin
require 'readline'
- 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 list_methods_matching
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def list_methods_matching name
found = []
find_methods name do |store, klass, ancestor, types, method|
if types == :instance or types == :both 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 display_name
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def display_name name
if name =~ /\w:(\w|$)/ then
display_page name
return true
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 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 process_args
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.process_args argv
options = default_options
opts = OptionParser.new do |opt|
opt.accept File do |file,|
- 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 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 add_class
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def add_class out, name, classes
heading = if classes.all? { |klass| klass.module? } then
name
else
superclass = classes.map do |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 interactive
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def interactive
puts "\nEnter the method name you want to look up."
begin
require 'readline'
Method find_methods
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def find_methods name
klass, selector, method = parse_name name
types = method_type selector
Method ancestors_of
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def ancestors_of klass
ancestors = []
unexamined = [klass]
seen = []
- 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_name
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_name name
parts = name.split(/(::?|#|\.)/)
if parts.length == 1 then
if parts.first =~ /^[a-z]|^([%&*+\/<>^`|~-]|\+@|-@|<<|<=>?|===?|=>|=~|>>|\[\]=?|~@)$/ 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 list_known_classes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def list_known_classes names = []
classes = []
stores.each do |store|
classes << store.module_names
- 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_methods
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_methods name
klass, selector, method = parse_name name
types = method_type selector
- 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 run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run
if @list_doc_dirs then
puts @doc_dirs
elsif @list then
list_known_classes @names
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def complete_klass name, klass, selector, method, completions # :nodoc:
Method load_method
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def load_method store, cache, klass, type, name
Method class_document
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def class_document name, found, klasses, includes, extends
Method check_did_you_mean
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_did_you_mean # :nodoc:
if defined? DidYouMean::SpellChecker
true
else
begin
- 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_method
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load_method store, cache, klass, type, name
methods = store.public_send(cache)[klass]
return unless methods
- 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 display_page
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def display_page name
store_name, page_name = name.split ':', 2
store = @stores.find { |s| s.source == store_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 render_method_comment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render_method_comment out, method, alias_for = nil# :nodoc:
if alias_for
unless method.comment.nil? or method.comment.empty?
out << RDoc::Markup::BlankLine.new
out << method.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 render_class
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render_class out, store, klass, also_in # :nodoc:
comment = klass.comment
# TODO the store's cache should always return an empty Array
class_methods = store.class_methods[klass.full_name] || []
instance_methods = store.instance_methods[klass.full_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 classes_and_includes_and_extends_for
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def classes_and_includes_and_extends_for name
klasses = []
extends = []
includes = []
- 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"