queirozfcom/rachinations

View on GitHub
lib/rachinations/domain/nodes/converter.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Method trigger! has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  def trigger!

    if all?

      if incoming_edges.all? { |edge| edge.test_pull?(require_all: true) } && outgoing_edges.all? { |edge| edge.test_push?(require_all:true) }
Severity: Minor
Found in lib/rachinations/domain/nodes/converter.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 make_resource has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def make_resource(&condition)

    if untyped?
      res = Token.new
      if condition.match_resource?(res)
Severity: Minor
Found in lib/rachinations/domain/nodes/converter.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 push_all! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def push_all!
    outgoing_edges
    .shuffle
    .each do |edge|
      begin
Severity: Minor
Found in lib/rachinations/domain/nodes/converter.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 pull_any! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def pull_any!
    incoming_edges
    .shuffle
    .each do |edge|
      begin
Severity: Minor
Found in lib/rachinations/domain/nodes/converter.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 put_resource! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def put_resource!(res, edge=nil)
    inv { !edge.nil? }
    if all?
      if incoming_edges.all? { |e| e.test_push? }
        push_all!
Severity: Minor
Found in lib/rachinations/domain/nodes/converter.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