Showing 1,321 of 1,541 total issues
Method set_filesystem_paths
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def set_filesystem_paths
@prefixdir = @prefixdir ? expand_install_dir(@prefixdir) : @sourcedir
if @appdir
dir = expand_install_dir @appdir
- 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 Installer
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class Gem::Installer
##
# Paths where env(1) might live. Some systems are broken and have it in
# /bin
File gem_dependency_api.rb
has 409 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Gem::RequestSet::GemDependencyAPI
ENGINE_MAP = { # :nodoc:
:jruby => %w[jruby],
:jruby_18 => %w[jruby],
Method expand_path
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def self.expand_path(path, dir=nil)
path = Rubinius::Type.coerce_to_path(path)
str = "".force_encoding path.encoding
first = path[0]
if first == ?~
- 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 const_get
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def self.const_get(mod, name, inherit=true, resolve=true)
unless object_kind_of? name, Symbol
name = StringValue(name)
if name.index '::' and name.size > 2
return const_lookup mod, name, inherit, resolve
- 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 exception.rb
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Exception
attr_accessor :locations
attr_accessor :cause
attr_accessor :custom_backtrace
Method validate
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate packaging = true
@warnings = 0
require 'rubygems/user_interaction'
extend Gem::UserInteraction
normalize
File enumerator.rb
has 402 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Enumerator
include Enumerable
attr_writer :args
private :args=
Method raise
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def raise(exc=undefined, msg=undefined, ctx=nil, cause: nil)
if undefined.equal? exc
exc = $!
exc = RuntimeError.new("No current exception") unless exc
exc.cause = cause unless exc.cause or exc == cause
- 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 time.rb
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Time
include Comparable
def self.now
Rubinius.primitive :time_s_now
File ffi.rb
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Rubinius
module FFI
# Specialised error classes
class TypeError < RuntimeError; end
Method install
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def install options, &block # :yields: request, installer
if dir = options[:install_dir]
requests = install_into dir, false, options, &block
return requests
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 include_modules_from
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def self.include_modules_from(included_module, klass)
insert_at = klass
constants_changed = false
mod = included_module
- 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 alpha.rb
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
class NilClass
def nil?
true
end
Class CompiledCode
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class CompiledCode < Executable
def self.allocate
Rubinius.primitive :compiledcode_allocate
raise PrimitiveFailure, "CompiledCode.allocate primitive failed"
end
Class Float
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class Float < Numeric
def **(other)
Rubinius.primitive :float_pow
if other.is_a?(Float) && self < 0 && other != other.round
Method execute
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def execute
specs = if options[:all] then
Gem::Specification.map
# `--extensions` must be explicitly given to pristine only gems
- 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 Command
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class Gem::Command
include Gem::UserInteraction
##
Class Numeric
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class Numeric
include Comparable
# Always raises TypeError, as dup'ing Numerics is not allowed.
def initialize_copy(other)
File options.rb
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'mspec/version'
class MSpecOption
attr_reader :short, :long, :arg, :description, :block