nulldb/nulldb

View on GitHub

Showing 6 of 6 total issues

Class NullDBAdapter has 44 methods (exceeds 20 allowed). Consider refactoring.
Open

class ActiveRecord::ConnectionAdapters::NullDBAdapter < ActiveRecord::ConnectionAdapters::AbstractAdapter

  # A convenience method for integratinginto RSpec.  See README for example of
  # use.
  def self.insinuate_into_spec(config)
Severity: Minor
Found in lib/active_record/connection_adapters/nulldb_adapter/core.rb - About 6 hrs to fix

    File core.rb has 282 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class ActiveRecord::ConnectionAdapters::NullDBAdapter < ActiveRecord::ConnectionAdapters::AbstractAdapter
    
      # A convenience method for integratinginto RSpec.  See README for example of
      # use.
      def self.insinuate_into_spec(config)
    Severity: Minor
    Found in lib/active_record/connection_adapters/nulldb_adapter/core.rb - About 2 hrs to fix

      Method add_index_options has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def add_index_options(table_name, column_name, options = {})
            column_names = Array.wrap(column_name)
            index_name   = index_name(table_name, :column => column_names)
      
            if Hash === options # legacy support, since this param was a string
      Severity: Minor
      Found in lib/active_record/connection_adapters/nulldb_adapter/core.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 insert has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def insert(statement, name = nil, primary_key = nil, object_id = nil, sequence_name = nil, binds = [])
      Severity: Minor
      Found in lib/active_record/connection_adapters/nulldb_adapter/core.rb - About 45 mins to fix

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

          def columns(table_name, name = nil)
            if @tables.size <= 1
              ActiveRecord::Migration.verbose = false
              schema_path = if Pathname(@schema_path).absolute?
                              @schema_path
        Severity: Minor
        Found in lib/active_record/connection_adapters/nulldb_adapter/core.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

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

          def initialize(config={})
            @log            = StringIO.new
            @logger         = Logger.new(@log)
            @last_unique_id = 0
            @tables         = {'schema_info' => new_table_definition(nil)}
        Severity: Minor
        Found in lib/active_record/connection_adapters/nulldb_adapter/core.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