nulldb/nulldb

View on GitHub

Showing 4 of 4 total issues

Class NullDBAdapter has 47 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 290 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 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 = [], returning: nil)
      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

        Severity
        Category
        Status
        Source
        Language