departurerb/departure

View on GitHub

Showing 3 of 3 total issues

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

      def new_column(field, default, type_metadata, null, table_name, default_function, collation, comment)
Severity: Major
Found in lib/active_record/connection_adapters/percona_adapter.rb - About 1 hr to fix

    Method exec_insert has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def exec_insert(sql, name, binds, pk = nil, sequence_name = nil, returning: nil) # rubocop:disable Lint/UnusedMethodArgument, Metrics/LineLength, Metrics/ParameterLists
    Severity: Minor
    Found in lib/active_record/connection_adapters/percona_adapter.rb - About 35 mins to fix

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

          def default_value
            match = if definition.match?(/timestamp|datetime/i)
                      /default '?(.+[^'])'?/i.match(definition)
                    else
                      /default '?(\w+)'?/i.match(definition)
      Severity: Minor
      Found in lib/lhm/column_with_sql.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

      Severity
      Category
      Status
      Source
      Language