jaredbeck/graph_matching

View on GitHub

Showing 45 of 76 total issues

Method augment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def augment(m, path)
        assert_valid_aug_path(path)
        ix = 0
        while ix < path.length
          i = path[ix]
Severity: Minor
Found in lib/graph_matching/algorithm/mcm_bipartite.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 gabow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def self.gabow(mate)
      m = new
      mate.each_with_index do |n1, ix|
        next if n1.nil? || n1 == 0
        n2 = mate[n1]
Severity: Minor
Found in lib/graph_matching/matching.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 consider_tight_edge has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def consider_tight_edge(k, w, p, v)
        augmented = false

        if @label[@in_blossom[w]] == LBL_FREE

Severity: Minor
Found in lib/graph_matching/algorithm/mwm_general.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 intersect? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def intersect?(set)
      unless set.is_a?(Set)
        raise ArgumentError, 'value must be a set'
      end
      if size < set.size
Severity: Minor
Found in lib/graph_matching/core_ext/set.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 assign_label has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def assign_label(w, t, p = nil)
        b = @in_blossom[w]
        assert_label(w, LBL_FREE)
        assert_label(b, LBL_FREE)
        @label[w] = @label[b] = t
Severity: Minor
Found in lib/graph_matching/algorithm/mwm_general.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

Severity
Category
Status
Source
Language