CocoaPods/Molinillo

View on GitHub
lib/molinillo/resolution.rb

Summary

Maintainability
D
2 days
Test Coverage
A
97%

File resolution.rb has 514 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Molinillo
  class Resolver
    # A specific resolution from a given {Resolver}
    class Resolution
      # A conflict that the resolution process encountered
Severity: Major
Found in lib/molinillo/resolution.rb - About 1 day to fix

    Class Resolution has 39 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class Resolution
          # A conflict that the resolution process encountered
          # @attr [Object] requirement the requirement that immediately led to the conflict
          # @attr [{String,Nil=>[Object]}] requirements the requirements that caused the conflict
          # @attr [Object, nil] existing the existing spec that was in conflict with
    Severity: Minor
    Found in lib/molinillo/resolution.rb - About 5 hrs to fix

      Method unwind_options_for_requirements has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def unwind_options_for_requirements(binding_requirements)
              unwind_details = []
      
              trees = []
              binding_requirements.reverse_each do |r|
      Severity: Minor
      Found in lib/molinillo/resolution.rb - About 2 hrs to fix

        Method unwind_options_for_requirements has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

              def unwind_options_for_requirements(binding_requirements)
                unwind_details = []
        
                trees = []
                binding_requirements.reverse_each do |r|
        Severity: Minor
        Found in lib/molinillo/resolution.rb - About 1 hr to fix

        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 resolve has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

              def resolve
                start_resolution
        
                while state
                  break if !state.requirement && state.requirements.empty?
        Severity: Minor
        Found in lib/molinillo/resolution.rb - About 1 hr to fix

        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 binding_requirements_for_conflict has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

              def binding_requirements_for_conflict(conflict)
                return [conflict.requirement] if conflict.possibility.nil?
        
                possible_binding_requirements = conflict.requirements.values.flatten(1).uniq
        
        
        Severity: Minor
        Found in lib/molinillo/resolution.rb - About 55 mins to fix

        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 attempt_to_activate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def attempt_to_activate
                debug(depth) { 'Attempting to activate ' + possibility.to_s }
                existing_vertex = activated.vertex_named(name)
                if existing_vertex.payload
                  debug(depth) { "Found existing spec (#{existing_vertex.payload})" }
        Severity: Minor
        Found in lib/molinillo/resolution.rb - About 45 mins to fix

        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 create_conflict has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

              def create_conflict(underlying_error = nil)
                vertex = activated.vertex_named(name)
                locked_requirement = locked_requirement_named(name)
        
                requirements = {}
        Severity: Minor
        Found in lib/molinillo/resolution.rb - About 35 mins to fix

        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 push_state_for_requirements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

              def push_state_for_requirements(new_requirements, requires_sort = true, new_activated = activated)
                new_requirements = sort_dependencies(new_requirements.uniq, new_activated, conflicts) if requires_sort
                new_requirement = nil
                loop do
                  new_requirement = new_requirements.shift
        Severity: Minor
        Found in lib/molinillo/resolution.rb - About 35 mins to fix

        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 indicate_progress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def indicate_progress
                @iteration_counter += 1
                @progress_rate ||= resolver_ui.progress_rate
                if iteration_rate.nil?
                  if Time.now - started_at >= @progress_rate
        Severity: Minor
        Found in lib/molinillo/resolution.rb - About 25 mins to fix

        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 parent_of has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def parent_of(requirement)
                return unless requirement
                return unless index = @parents_of[requirement].last
                return unless parent_state = @states[index]
                parent_state.requirement
        Severity: Minor
        Found in lib/molinillo/resolution.rb - About 25 mins to fix

        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

        There are no issues that match your filters.

        Category
        Status