plentz/lol_dba

View on GitHub

Showing 83 of 83 total issues

Assignment Branch Condition size for check_for_indexes is too high. [29.83/15]
Open

def self.check_for_indexes
eager_load_if_needed
 
required_indexes = Hash.new([])
 
 

Method has too many lines. [24/10]
Open

def self.check_for_indexes
eager_load_if_needed
 
required_indexes = Hash.new([])
 
 

Method check_for_indexes has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def self.check_for_indexes
eager_load_if_needed
 
required_indexes = Hash.new([])
 
 
Severity: Minor
Found in lib/lol_dba/index_finding/index_finder.rb - About 2 hrs to fix

Complex method LolDba::IndexFinder::check_for_indexes (39.4)
Open

def self.check_for_indexes
eager_load_if_needed
 
required_indexes = Hash.new([])
 
 

Method has too many lines. [12/10]
Open

def parse_options
options = {}
OptionParser.new do |opts|
opts.on('-d', '--debug',
'Show stack traces when an error occurs.') do |opt|
Severity: Minor
Found in lib/lol_dba/cli.rb by rubocop

Assignment Branch Condition size for find_association_fk is too high. [17.52/15]
Open

def find_association_fk
if (source = reflection_options.options[:source])
association_reflection = through_reflections[source.to_s]
return nil if association_reflection.options[:polymorphic]
get_through_foreign_key(association_reflection.klass, reflection_options)

LolDba::CLI#select_action refers to 'arg' more than self (maybe move it to another class?)
Open

if arg =~ /db:find_indexes/
success = LolDba::IndexFinder.run
exit(1) if success
elsif arg !~ /\[/
LolDba::SqlGenerator.run('all')
Severity: Minor
Found in lib/lol_dba/cli.rb by reek

LolDba::ErrorLogging#self.log has approx 10 statements
Open

def self.log(model_class, reflection_options, exception)

LolDba::MigrationMocker#redefine_metadata_methods has approx 14 statements
Open

def redefine_metadata_methods

LolDba::MigrationFormatter#format_for_migration has approx 6 statements
Open

def format_for_migration(missing_indexes)

LolDba::Migration#generate_instead_of_executing refers to 'migration_mocker' more than self (maybe move it to another class?)
Open

migration_mocker.redefine_migration_methods
yield
migration_mocker.reset_methods

LolDba::IndexFinder#self.check_for_indexes has approx 15 statements
Open

def self.check_for_indexes

LolDba::CLI#start has approx 7 statements
Open

def start(arg)
Severity: Minor
Found in lib/lol_dba/cli.rb by reek

LolDba::BelongsTo#relation_columns has approx 7 statements
Open

def relation_columns

LolDba::IndexFinder#self.missing_indexes has approx 6 statements
Open

def self.missing_indexes(indexes_required)

LolDba::CLI#parse_options contains iterators nested 2 deep
Open

opts.on('-d', '--debug',
Severity: Minor
Found in lib/lol_dba/cli.rb by reek

LolDba::MigrationFormatter#format_for_migration contains iterators nested 2 deep
Open

keys_to_add.each do |key|

LolDba::IndexFinder#self.check_for_indexes contains iterators nested 2 deep
Open

reflections.each_pair do |reflection_name, reflection_options|

LolDba::CLI#parse_options has approx 8 statements
Open

def parse_options
Severity: Minor
Found in lib/lol_dba/cli.rb by reek

LolDba::IndexFinder has no descriptive comment
Open

class IndexFinder
Severity
Category
Status
Source
Language