lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
Class OracleEnhancedAdapter
has 56 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class OracleEnhancedAdapter < AbstractAdapter
include OracleEnhanced::DatabaseStatements
include OracleEnhanced::SchemaStatements
include OracleEnhanced::ContextIndex
include OracleEnhanced::Quoting
File oracle_enhanced_adapter.rb
has 498 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "arel/visitors/oracle"
require "arel/visitors/oracle12"
require "active_record/connection_adapters"
require "active_record/connection_adapters/abstract_adapter"
require "active_record/connection_adapters/statement_pool"
Method reset_pk_sequence!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def reset_pk_sequence!(table_name, primary_key = nil, sequence_name = nil) # :nodoc:
return nil unless data_source_exists?(table_name)
unless primary_key && sequence_name
# *Note*: Only primary key is implemented - sequence will be nil.
primary_key, sequence_name = pk_and_sequence_for(table_name)
- Read upRead up
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"