Showing 34 of 34 total issues
Class Environment
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class Environment
include Support::AbstractMethod
attr_accessor :ui
Class Database
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Database
class << self
def library
name.split("::").first.downcase
Class ManifestSet
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class ManifestSet
class << self
def shallow_strip(manifests, names)
new(manifests).shallow_strip!(names).send(method_for(manifests))
Class Implementation
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Implementation
class MultiSource
attr_accessor :sources
def initialize(sources)
Method cache!
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def cache!
repository_cached? and return or repository_cached!
unless repository.git?
repository.path.rmtree if repository.path.exist?
- 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 Cli
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Cli < Thor
autoload :ManifestPresenter, "librarian/cli/manifest_presenter"
include Thor::Actions
Class Repository
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Repository
class << self
def clone!(environment, path, repository_url)
path = Pathname.new(path)
Class SpecChangeSet
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class SpecChangeSet
attr_accessor :environment
private :environment=
attr_reader :spec, :lock
Method config
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def config(key = nil, value = nil)
if key
raise Error, "cannot set both value and delete" if value && options["delete"]
if options["delete"]
scope = config_scope(true)
- 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 Manifest
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Manifest
attr_accessor :source, :name, :extra
private :source=, :name=, :extra=
Method enforce_consistency!
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def enforce_consistency!(dependencies, manifests)
manifest_set = ManifestSet.new(manifests)
return if manifest_set.in_compliance_with?(dependencies)
return if manifest_set.consistent?
- 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 run
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def run(specfile = nil, sources = [], &block)
specfile, sources = nil, specfile if specfile.kind_of?(Array) && sources.empty?
Target.new(self).tap do |target|
target.precache_sources(sources)
- 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 enforce_consistency!
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def enforce_consistency!(dependencies, manifests)
manifest_set = ManifestSet.new(manifests)
return if manifest_set.in_compliance_with?(dependencies)
return if manifest_set.consistent?
Method logging_command
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def logging_command(command, options)
silent = options.delete(:silent)
pwd = Dir.pwd
- 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 logging_command
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def logging_command(command, options)
silent = options.delete(:silent)
pwd = Dir.pwd
Method do_resolve
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def do_resolve(state)
stack = [state]
while !stack.empty? do
state = stack.pop
shift_resolved_enqueued_dependencies(state) or return
- 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 extract_and_parse_sources
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def extract_and_parse_sources(lines)
sources = []
while source_type_names.include?(lines.first)
source = {}
source_type_name = lines.shift
Method debug
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def debug(string = nil, &block)
return unless ui
if ui.respond_to?(:debug_line_numbers) && ui.debug_line_numbers
loc = caller.find{|l| !(l =~ /in `debug'$/)}
- 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 run!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run!(command, options = { })
i, o, e = IO.pipe, IO.pipe, IO.pipe
pid = fork do
$stdin.reopen i[0]
$stdout.reopen o[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 extract_and_parse_sources
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def extract_and_parse_sources(lines)
sources = []
while source_type_names.include?(lines.first)
source = {}
source_type_name = lines.shift
- 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"