Showing 406 of 406 total issues
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 parse_entries
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_entries
@time_cache ||= {}
if /\A((?:.*\n){,3})commit\s/ =~ @content
class << self; prepend Git; end
Method visit_call_node
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def visit_call_node(node)
@scanner.process_comments_until(node.location.start_line - 1)
if node.receiver.nil?
case node.name
when :attr
Method handle_class_module
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_class_module(var_name, type, class_name, parent, in_module)
parent_name = @known_classes[parent] || parent
if in_module then
enclosure = @classes[in_module] || @store.find_c_enclosure(in_module)
Method resolve_method
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def resolve_method name
ref = nil
if /#{CLASS_REGEXP_STR}([.#]|::)#{METHOD_REGEXP_STR}/o =~ name then
type = $2
Method find_method_or_attribute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def find_method_or_attribute name # :nodoc:
return nil unless parent.respond_to? :ancestors
searched = parent.ancestors
kernel = @store.modules_hash['Kernel']
- 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_words_tk
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private def get_words_tk(tk)
string = ''
start_token = tk[:text]
start_quote = tk[:text].rstrip[-1]
line_no = tk[:line_no]
- 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 time_delta_string
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def time_delta_string seconds
return 'less than a minute' if seconds < 60
return "#{seconds / 60} minute#{seconds / 60 == 1 ? '' : 's'}" if
seconds < 3000 # 50 minutes
return 'about one hour' if seconds < 5400 # 90 minutes
- 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_squashed_tk
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_squashed_tk
if @buf.empty?
tk = @tokens.shift
else
tk = @buf.shift
- 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 module
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def module
return @module if @module
# search the current context
return @name unless parent
- 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 handle_constants
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def handle_constants(type, var_name, const_name, definition)
class_name = @known_classes[var_name]
return unless class_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 find_or_create_module_path
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def find_or_create_module_path(module_name, create_mode)
root_name, *path, name = module_name.split('::')
add_module = ->(mod, name, mode) {
case mode
when :class
- 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 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 marshal_dump
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def marshal_dump # :nodoc:
attrs = attributes.sort.map do |attr|
next unless attr.display?
[ attr.name, attr.rw,
attr.visibility, attr.singleton, attr.file_name,
Function performSearch
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function performSearch(data, regexps, queries, highlighters, state) {
var searchIndex = data.searchIndex;
var longSearchIndex = data.longSearchIndex;
var info = data.info;
var result = [];
Method generate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate
return if @spec.default_gem?
return unless @generate_ri or @generate_rdoc
setup
Method do_methods
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def do_methods
@content.scan(%r%rb_define_
(
singleton_method |
method |
Method do_constants
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def do_constants
@content.scan(%r%\Wrb_define_
( variable |
readonly_variable |
const |
Method prepare_comments
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def prepare_comments(comments)
current = []
consecutive_comments = [current]
@modifier_comments = {}
comments.each do |comment|