Showing 25 of 27 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
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 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 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 recursive_resolve
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def recursive_resolve(state)
shift_resolved_enqueued_dependencies(state) or return
state.queue.empty? and return state.manifests
state.dependencies << state.queue.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"
Further reading
Method default_project_root_path
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def default_project_root_path
if root
root
else
path = underlying_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 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"
Further reading
Method each_cyclic_strongly_connected_component_set
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def each_cyclic_strongly_connected_component_set(graph)
return enum_for(__method__, graph) unless block_given?
GraphHash.from(graph).each_strongly_connected_component do |scc|
if scc.size == 1
n = scc.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 config_scope
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def config_scope(exclusive)
g, l = "global", "local"
if exclusive
options[g] ^ options[l] or raise Error, "must set either #{g} or #{l}"
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"