jaredbeck/graph_matching

View on GitHub
lib/graph_matching/algorithm/mcm_general.rb

Summary

Maintainability
C
1 day
Test Coverage

Method e has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

      def e(g)
        first = []
        label = []
        mate = []

Severity: Minor
Found in lib/graph_matching/algorithm/mcm_general.rb - About 4 hrs 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 l has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

      def l(x, y, first, label, mate, q, visited_nodes)
        # L0. [Initialize.] Set r <- FIRST(x), s <= FIRST(y).
        # If r = s, return (no vertices can be labeled).
        # Otherwise flag r and s. (Steps L1-L2 find join by advancing
        # alternately along paths P(x) and P(y). Flags are assigned
Severity: Minor
Found in lib/graph_matching/algorithm/mcm_general.rb - About 2 hrs 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 e has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def e(g)
        first = []
        label = []
        mate = []

Severity: Major
Found in lib/graph_matching/algorithm/mcm_general.rb - About 2 hrs to fix

    Method l has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def l(x, y, first, label, mate, q, visited_nodes)
            # L0. [Initialize.] Set r <- FIRST(x), s <= FIRST(y).
            # If r = s, return (no vertices can be labeled).
            # Otherwise flag r and s. (Steps L1-L2 find join by advancing
            # alternately along paths P(x) and P(y). Flags are assigned
    Severity: Minor
    Found in lib/graph_matching/algorithm/mcm_general.rb - About 1 hr to fix

      Method l has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def l(x, y, first, label, mate, q, visited_nodes)
      Severity: Major
      Found in lib/graph_matching/algorithm/mcm_general.rb - About 50 mins to fix

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

              def r(v, w, label, mate)
                # R1. [Match v to w ] Set t <- MATE(v), MATE(v) <- w.
                # If MATE(t) != v, return (the path is completely re-matched)
        
                t = mate[v]
        Severity: Minor
        Found in lib/graph_matching/algorithm/mcm_general.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

        There are no issues that match your filters.

        Category
        Status