Showing 1,079 of 1,541 total issues
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
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:
#
Method find_gems_with_sources
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def find_gems_with_sources dep, best_only=false # :nodoc:
set = Gem::AvailableSet.new
if consider_local?
sl = Gem::Source::Local.new
- 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 byteslice
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def byteslice(index_or_range, length=undefined)
Rubinius.primitive :string_byte_substring
if index_or_range.kind_of? Range
index = Rubinius::Type.coerce_to index_or_range.begin, Fixnum, :to_int
- 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 sub
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def sub(pattern, replacement=undefined)
# Because of the behavior of $~, this is duplicated from sub! because
# if we call sub! from sub, the last_match can't be updated properly.
unless valid_encoding?
- 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 sub!
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def sub!(pattern, replacement=undefined)
# Because of the behavior of $~, this is duplicated from sub! because
# if we call sub! from sub, the last_match can't be updated properly.
unless valid_encoding?
- 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 Complex
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Complex < Numeric
undef_method :%
undef_method :<
undef_method :<=
Method alien
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def alien(gems=[])
errors = Hash.new { |h,k| h[k] = {} }
Gem::Specification.each do |spec|
next unless gems.include? spec.name unless gems.empty?
- 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 generate
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def generate
typedefs = BodyGuard.new(self, "ffi_types_generator", @platform).perform
code = ""
- 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"