Showing 1,321 of 1,541 total issues
Method show
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def show(sep="\n", show_color=true)
show_color = false unless @colorize
clear = show_color ? "\033[0m" : ""
max = 0
- 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 licenses.rb
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rubygems/text'
class Gem::Licenses
extend Gem::Text
Method inspect
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inspect
result_encoding = Encoding.default_internal || Encoding.default_external
unless result_encoding.ascii_compatible?
result_encoding = Encoding::US_ASCII
end
Class Loader
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class Loader
def initialize
@exit_code = 0
@process_id = Process.pid
@load_paths = []
Class Pointer
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class Pointer
include PointerAccessors
def initialize(a1, a2=undefined)
if undefined.equal? a2
File dependency_grapher.rb
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'set'
module Daedalus
class DependencyGrapher
DEV_NULL = RUBY_PLATFORM =~ /mingw|mswin/ ? 'NUL' : '/dev/null'
Method doctor_child
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def doctor_child sub_directory, extension # :nodoc:
directory = File.join(@gem_repository, sub_directory)
Dir.entries(directory).sort.each do |ent|
next if ent == "." || ent == ".."
- 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 verify_call
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def self.verify_call(obj, sym, *args, &block)
compare = *args
behaves_like_ruby_1_9 = *[]
if (behaves_like_ruby_1_9)
compare = compare.first if compare.length <= 1
- 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 check_tools
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def check_tools
@cc ||= ENV['CC'] || default_cc
@cxx ||= ENV['CXX'] || default_cxx
check_tool_version @cc, '-dumpversion', [4, 1]
- 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 bsearch
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def bsearch
return to_enum :bsearch unless block_given?
unless @begin.kind_of? Numeric and @end.kind_of? Numeric
raise TypeError, "bsearch is not available for #{@begin.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 rb_integer_pack
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def self.rb_integer_pack(value, words, numwords, wordsize, nails, flags)
digits = INTEGER_PACK_DIGITS
numbytes = numwords * wordsize
nibble_size = numbytes * 2
- 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 chunk
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def chunk
raise ArgumentError, "no block given" unless block_given?
::Enumerator.new do |yielder|
previous = nil
accumulate = []
- 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 last_error
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def last_error
error = Rubinius.invoke_primitive :encoding_converter_last_error, self
return if error.nil?
result = error[:result]
- 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
Class Regexp
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class Regexp
def self.allocate
Rubinius.primitive :regexp_allocate
raise PrimitiveFailure, "Regexp.allocate primitive failed"
end
File package.rb
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rubygems/security'
require 'rubygems/specification'
require 'rubygems/user_interaction'
require 'zlib'
Method use_gemdeps
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def self.use_gemdeps path = nil
raise_exception = path
path ||= ENV['RUBYGEMS_GEMDEPS']
return unless 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
Method search
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def self.search(source, target)
if entry = TranscodingMap[source]
if entry[target]
return [source, target]
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 parse_stream
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_stream(f)
class_pattern = /class\s+([^\s]+)\s*:\s*public\s+([^\s]+)/
slot_pattern = %r!^\s*(\w+)\*?\s+\*?_(\w+)_\s*;\s*//\s*slot(.*)!
accessor_pattern = %r!^\s*attr_(accessor|reader|writer)\((\w+),\s*(\w+)\)!
primitive_pattern = %r%^\s*//\s+Rubinius.primitive([?!\+])?\s+:(.*)\s*$%
Class EnvironmentVariables
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class EnvironmentVariables
include Enumerable
def [](key)
value = getenv(StringValue(key))
Class ARGFClass
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class ARGFClass
include Enumerable
# :internal:
#