Showing 372 of 392 total issues
Method write_style_sheet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def write_style_sheet
debug_msg "Copying static files"
options = { :verbose => $DEBUG_RDOC, :noop => @dry_run }
BUILTIN_STYLE_ITEMS.each do |item|
- 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_comment_ghost
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_comment_ghost container, text, name, column, line_no, # :nodoc:
comment
Method parse_meta_attr
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_meta_attr(context, single, tk, comment)
args = parse_symbol_arg
rw = "?"
# If nodoc is given, don't document any of them
- 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
Avoid deeply nested control flow statements. Open
parse_comment container, tk, comment unless comment.empty?
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(base, commit, author, email, date, contents)
Avoid deeply nested control flow statements. Open
elsif :on_nl == tk[:kind] then
if nest <= 0 and RDoc::Parser::RipperStateLex.end?(tk) then
unget_tk tk
break
end
Avoid deeply nested control flow statements. Open
line_no = tk[:line_no] if comment.empty?
Method load_cache
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_cache
#orig_enc = @encoding
@cache = marshal_load(cache_path)
- 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
Avoid deeply nested control flow statements. Open
if nest <= 0 and (next_tk.nil? || :on_nl == next_tk[:kind]) then
create_module_alias container, constant, rhs_name unless is_array_or_hash
break
end
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
Avoid deeply nested control flow statements. Open
if comment_body.size > 1 && comment_body =~ /\n\z/ then
skip_tkspace_without_nl # leading spaces
end
Avoid deeply nested control flow statements. Open
comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
Avoid deeply nested control flow statements. Open
if container.done_documenting then
throw :eof if RDoc::TopLevel === container
container.ongoing_visibility = save_visibility
end
Method handle_method
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_method(type, var_name, meth_name, function, param_count,
source_file = nil)
Method do_methods
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def do_methods
@content.scan(%r%rb_define_
(
singleton_method |
method |
- 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_class_named_from
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_class_named_from name, from
from = find_class_named from unless RDoc::Context === from
until RDoc::TopLevel === from do
return nil unless from
- 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
Avoid deeply nested control flow statements. Open
comment << "\n" unless comment_body =~ /\n\z/
Avoid deeply nested control flow statements. Open
warn "Warning: yield outside of method" if container.document_self
Avoid deeply nested control flow statements. Open
non_comment_seen = parse_comment container, tk, comment unless
comment.empty?