ifad/chronomodel

View on GitHub
lib/chrono_model/adapter/ddl.rb

Summary

Maintainability
A
3 hrs
Test Coverage
A
96%

Method chrono_create_UPDATE_trigger has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def chrono_create_UPDATE_trigger(table, pk, current, history, fields, values, options, columns)
Severity: Major
Found in lib/chrono_model/adapter/ddl.rb - About 1 hr to fix

    Method chrono_public_view_ddl has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

          def chrono_public_view_ddl(table, options = nil)
            pk      = primary_key(table)
            current = "#{TEMPORAL_SCHEMA}.#{table}"
            history = "#{HISTORY_SCHEMA}.#{table}"
    
    
    Severity: Minor
    Found in lib/chrono_model/adapter/ddl.rb - About 55 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 chrono_create_INSERT_trigger has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def chrono_create_INSERT_trigger(table, pk, current, history, fields, values)
    Severity: Minor
    Found in lib/chrono_model/adapter/ddl.rb - About 45 mins to fix

      Method chrono_create_UPDATE_trigger has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def chrono_create_UPDATE_trigger(table, pk, current, history, fields, values, options, columns)
              # Columns to be journaled. By default everything except updated_at (GH #7)
              #
              journal =
                if options[:journal]
      Severity: Minor
      Found in lib/chrono_model/adapter/ddl.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