Showing 78 of 2,162 total issues
File string.rb
has 455 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('String') do |defs|
defs.define_constant('String') do |klass|
klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
klass.inherits(defs.constant_proxy('JSON::Ext::Generator::GeneratorMethods::String', RubyLint.registry))
klass.inherits(defs.constant_proxy('Comparable', RubyLint.registry))
File date.rb
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('Date') do |defs|
defs.define_constant('Date') do |klass|
klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
klass.inherits(defs.constant_proxy('Comparable', RubyLint.registry))
File kernel.rb
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('Kernel') do |defs|
defs.define_constant('Kernel') do |klass|
klass.define_method('Array') do |method|
method.define_argument('obj')
end
File drb.rb
has 398 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('DRb') do |defs|
defs.define_constant('DRb') do |klass|
klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
klass.define_method('config')
Class RubyObject
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class RubyObject
include VariablePredicates
##
# Array containing items that should be looked up in the parent
File basic_socket.rb
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('BasicSocket') do |defs|
defs.define_constant('BasicSocket') do |klass|
klass.inherits(defs.constant_proxy('IO', RubyLint.registry))
klass.define_method('do_not_reverse_lookup')
File hash.rb
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('Hash') do |defs|
defs.define_constant('Hash') do |klass|
klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
klass.inherits(defs.constant_proxy('JSON::Ext::Generator::GeneratorMethods::Hash', RubyLint.registry))
klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))
File unixsocket.rb
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('UNIXSocket') do |defs|
defs.define_constant('UNIXSocket') do |klass|
klass.inherits(defs.constant_proxy('BasicSocket', RubyLint.registry))
klass.inherits(defs.constant_proxy('IO::TransferIO', RubyLint.registry))
File tcpsocket.rb
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('TCPSocket') do |defs|
defs.define_constant('TCPSocket') do |klass|
klass.inherits(defs.constant_proxy('IPSocket', RubyLint.registry))
klass.define_method('gethostbyname') do |method|
File udpsocket.rb
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('UDPSocket') do |defs|
defs.define_constant('UDPSocket') do |klass|
klass.inherits(defs.constant_proxy('IPSocket', RubyLint.registry))
klass.define_instance_method('bind') do |method|
File ipsocket.rb
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('IPSocket') do |defs|
defs.define_constant('IPSocket') do |klass|
klass.inherits(defs.constant_proxy('BasicSocket', RubyLint.registry))
klass.define_method('getaddress') do |method|
File zlib.rb
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('Zlib') do |defs|
defs.define_constant('Zlib') do |klass|
klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
klass.define_method('adler32')
File tcpserver.rb
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('TCPServer') do |defs|
defs.define_constant('TCPServer') do |klass|
klass.inherits(defs.constant_proxy('TCPSocket', RubyLint.registry))
klass.inherits(defs.constant_proxy('Socket::ListenAndAccept', RubyLint.registry))
klass.inherits(defs.constant_proxy('IO::Socketable', RubyLint.registry))
File json.rb
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('JSON') do |defs|
defs.define_constant('JSON') do |klass|
klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
klass.define_method('[]') do |method|
File matrix.rb
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('Matrix') do |defs|
defs.define_constant('Matrix') do |klass|
klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
klass.inherits(defs.constant_proxy('Matrix::CoercionHelper', RubyLint.registry))
klass.inherits(defs.constant_proxy('ExceptionForMatrix', RubyLint.registry))
File unixserver.rb
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('UNIXServer') do |defs|
defs.define_constant('UNIXServer') do |klass|
klass.inherits(defs.constant_proxy('UNIXSocket', RubyLint.registry))
klass.inherits(defs.constant_proxy('Socket::ListenAndAccept', RubyLint.registry))
klass.inherits(defs.constant_proxy('IO::Socketable', RubyLint.registry))
File prime.rb
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('Prime') do |defs|
defs.define_constant('Prime') do |klass|
klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))
File array.rb
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
RubyLint.registry.register('Array') do |defs|
defs.define_constant('Array') do |klass|
klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
klass.inherits(defs.constant_proxy('JSON::Ext::Generator::GeneratorMethods::Array', RubyLint.registry))
klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))
File ruby_object.rb
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module RubyLint
module Definition
##
# The RubyObject class is the base definition class of ruby-lint. These so
# called definition classes are used for storing information about Ruby
Method inspect_constants
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def inspect_constants(source = constant, ignore = [])
names = []
source_name = source.name
have_children = []
include_source = source != Object
- 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"