Method for
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
handled = Set.new
deps = dependencies.dup
specs = []
skip += ["bundler"]
- 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 SpecSet
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class SpecSet
include Enumerable
include TSort
def initialize(specs)
Method materialize
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def materialize(deps, missing_specs = nil)
materialized = self.for(deps, [], false, true, !missing_specs).to_a
deps = materialized.map(&:name).uniq
materialized.map! do |s|
next s unless s.is_a?(LazySpecification)
- 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 for
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
handled = Set.new
deps = dependencies.dup
specs = []
skip += ["bundler"]
Method materialized_for_all_platforms
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def materialized_for_all_platforms
names = @specs.map(&:name).uniq
@specs.map do |s|
next s unless s.is_a?(LazySpecification)
s.source.dependency_names = names if s.source.respond_to?(:dependency_names=)
- 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 for
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)