Method normalized_file_list
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def normalized_file_list(relative_files, force_doc = false,
exclude_pattern = nil)
file_list = {}
relative_files.each do |rel_file_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 setup_output_dir
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def setup_output_dir(dir, force)
flag_file = output_flag_file dir
last = {}
- 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 rdoc.rb
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative '../rdoc'
require 'find'
require 'fileutils'
require 'pathname'
Class RDoc
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class RDoc::RDoc
@current = nil
##
Method parse_file
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def parse_file filename
encoding = @options.encoding
filename = filename.encode encoding
@stats.add_file filename
- 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 parse_file
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_file filename
encoding = @options.encoding
filename = filename.encode encoding
@stats.add_file filename
Method document
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def document options
self.store = RDoc::Store.new
if RDoc::Options === options then
@options = options
Method normalized_file_list
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def normalized_file_list(relative_files, force_doc = false,
exclude_pattern = nil)
file_list = {}
relative_files.each do |rel_file_name|
Method setup_output_dir
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_output_dir(dir, force)
flag_file = output_flag_file dir
last = {}
Method gather_files
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def gather_files files
files = [@options.root.to_s] if files.empty?
file_list = normalized_file_list files, true, @options.exclude
- 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 generate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate
if @options.dry_run then
# do nothing
@generator.generate
else
- 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"