Showing 23 of 58 total issues
Class Base
has 48 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
# @return [String] the codebase's directory
attr_accessor :base_dir
# @param hash [Hash] hash returned via JSON interface
Class Base
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
# @param hash [Hash] hash returned via JSON interface
def initialize(hash)
@hash = hash
end
Class Base
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
# @param hash [Hash] hash returned via JSON interface
def initialize(hash)
@hash = hash
end
Class Base
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
extend Forwardable
include YARD::NodocHelper
# @return [YARD::CodeObjects::Base] the actual (YARD) code object
Class Base
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class Base < Inch::CodeObject::Proxy
def language
:ruby
end
Class Base
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class Base < Inch::CodeObject::Proxy
def language
:elixir
end
Class Base
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class Base < Inch::CodeObject::Proxy
def language
:javascript
end
Class MethodObject
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class MethodObject < Base
UNUSABLE_RETURN_VALUES = %w(nil nothing undefined void)
def aliases_fullnames
object.aliases.map(&:path)
Class Docstring
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Docstring
def initialize(text)
@text = text.to_s
end
Method parse_code_examples
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def parse_code_examples
code_examples = []
example = nil
@text.lines.each do |line|
if line =~ /^\s*+$/
- 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 implicit_nodoc_comment?
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def implicit_nodoc_comment?
return false if explicit_doc_comment?
if parent
return false if parent.explicit_doc_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 list_options
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_options(opts)
opts.separator ''
opts.separator 'List options:'
opts.on('--all', 'Show all objects in the output') do
Method relevant_base_roles
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def relevant_base_roles
{
Role::Object::InRoot => nil,
Role::Object::Public => nil,
Role::Object::Protected => nil,
Method get_term_columns
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_term_columns(default = 80)
str = `stty size 2>&1`
if str =~ /Invalid argument/
default
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"
Further reading
Method to_hash
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.to_hash(o)
attributes = {}
OBJECT_ATTRIBUTES.each do |name|
next unless o.respond_to?(name)
attributes[name] = o.public_send(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 name_from_tuple
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def name_from_tuple(a, _, b)
if b.nil? || b == 'Elixir'
a
else
if a == '\\\\'
- 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 name_from_tuple
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def name_from_tuple(a, _, b)
if b.nil? || b == 'Elixir'
a
else
if a == '\\\\'
- 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 initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(options, relevant_objects, objects_to_display,
grade_lists, files)
Method print_roles_info
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def print_roles_info(o)
if o.roles.empty?
echo 'No roles assigned.'.color(:dark)
else
o.roles.each do |role|
- 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 too many return
statements within this method. Open
return true