Method parse
has 409 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse argv
ignore_invalid = true
argv.insert(0, *ENV['RDOCOPT'].split) if ENV['RDOCOPT']
File options.rb
has 798 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'optparse'
require 'pathname'
##
# RDoc::Options handles the parsing and storage of options
Method parse
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
def parse argv
ignore_invalid = true
argv.insert(0, *ENV['RDOCOPT'].split) if ENV['RDOCOPT']
- 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 override
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def override map # :nodoc:
if map.has_key?('encoding')
encoding = map['encoding']
@encoding = encoding ? Encoding.find(encoding) : encoding
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
Class Options
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class RDoc::Options
##
# The deprecated options.
Method init_ivars
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def init_ivars # :nodoc:
@dry_run = false
@exclude = %w[
~\z \.orig\z \.rej\z \.bak\z
\.gemspec\z
Method override
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def override map # :nodoc:
if map.has_key?('encoding')
encoding = map['encoding']
@encoding = encoding ? Encoding.find(encoding) : encoding
end
Method load_options
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.load_options
options_file = File.expand_path '.rdoc_options'
return RDoc::Options.new unless File.exist? options_file
RDoc.load_yaml
- 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 finish
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def finish
if @write_options then
write_options
exit
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 check_files
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_files
@files.delete_if do |file|
if File.exist? file then
if File.readable? file then
false
- 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"