projectcypress/health-data-standards

View on GitHub
lib/hqmf-parser/converter/pass2/operator_converter.rb

Summary

Maintainability
C
1 day
Test Coverage

Method apply_summary has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def self.apply_summary(data_criteria, precondition, restriction, data_criteria_converter)
      value = restriction.operator.value
      type = restriction.operator.type
      subset_operator = HQMF::SubsetOperator.new(type, value)

Severity: Minor
Found in lib/hqmf-parser/converter/pass2/operator_converter.rb - About 3 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 apply_temporal has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def self.apply_temporal(data_criteria, precondition, restriction, data_criteria_converter)
      data_criteria.temporal_references ||= []
      value = restriction.operator.value
      type = restriction.operator.type
      temporal_reference = nil
Severity: Minor
Found in lib/hqmf-parser/converter/pass2/operator_converter.rb - About 3 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 apply_temporal has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def self.apply_temporal(data_criteria, precondition, restriction, data_criteria_converter)
      data_criteria.temporal_references ||= []
      value = restriction.operator.value
      type = restriction.operator.type
      temporal_reference = nil
Severity: Minor
Found in lib/hqmf-parser/converter/pass2/operator_converter.rb - About 1 hr to fix

    Method apply_summary has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def self.apply_summary(data_criteria, precondition, restriction, data_criteria_converter)
          value = restriction.operator.value
          type = restriction.operator.type
          subset_operator = HQMF::SubsetOperator.new(type, value)
    
    
    Severity: Minor
    Found in lib/hqmf-parser/converter/pass2/operator_converter.rb - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status