Showing 1,079 of 1,541 total issues
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
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
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
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
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'