MiraitSystems/enju_trunk

View on GitHub
lib/enju_leaf/porta_cql.rb

Summary

Maintainability
A
2 hrs
Test Coverage

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

  def split_clause_text(line)
    clauses = []

    s = StringScanner.new(line)
    text = ''
Severity: Minor
Found in lib/enju_leaf/porta_cql.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 logic_adapter has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def logic_adapter
    case
    when LOGIC_ALL.include?(@index)
      raise AdapterError unless %w[ALL ANY = EXACT ^].include?(@relation)
    when LOGIC_ANY.include?(@index)
Severity: Minor
Found in lib/enju_leaf/porta_cql.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 comp_date has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def comp_date(date)
    if date
      text = date.terms[0]
      date_text = case text
      when /\A\d{4}-\d{2}-\d{2}\Z/
Severity: Minor
Found in lib/enju_leaf/porta_cql.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