mena-devs/tilde

View on GitHub
lib/tasks/database.rake

Summary

Maintainability
Test Coverage

Showing 17 of 17 total issues

Block has too many lines. [28/25]
Open

namespace :db do
 
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Line is too long. [130/120]
Open

cmd = "pg_restore --verbose --host #{host} --username #{user} --clean --no-owner --no-acl --dbname #{db} #{latest_filename}"
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Prefer Time over DateTime.
Open

cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{db}_#{DateTime.now.strftime("%Y_%m_%d_%H%M%S")}.dump"
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Extra empty line detected at block body beginning.
Open

desc "Dumps the database to db/APP_NAME.dump"
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Space between { and | missing.
Open

latest_filename = Dir.glob("#{Rails.root}/db/backup/*.dump").max_by(1) {|f| File.mtime(f)}.first
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Line is too long. [184/120]
Open

cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{db}_#{DateTime.now.strftime("%Y_%m_%d_%H%M%S")}.dump"
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

Rake::Task["db:drop"].invoke
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Prefer single-quoted strings inside interpolations.
Open

cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{db}_#{DateTime.now.strftime("%Y_%m_%d_%H%M%S")}.dump"
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Unused block argument - app. If it's necessary, use _ or _app as an argument name to indicate that it won't be used.
Open

with_config do |app, host, db, user|
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Extra empty line detected at block body end.
Open

end
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Unused block argument - app. If it's necessary, use _ or _app as an argument name to indicate that it won't be used.
Open

with_config do |app, host, db, user|
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Use the new Ruby 1.9 hash syntax.
Open

task :dump => :environment do
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

desc "Dumps the database to db/APP_NAME.dump"
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Space missing inside }.
Open

latest_filename = Dir.glob("#{Rails.root}/db/backup/*.dump").max_by(1) {|f| File.mtime(f)}.first
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Use the new Ruby 1.9 hash syntax.
Open

task :restore => :environment do
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

desc "Restores the database dump at db/APP_NAME.dump."
Severity: Minor
Found in lib/tasks/database.rake by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

Rake::Task["db:create"].invoke
Severity: Minor
Found in lib/tasks/database.rake by rubocop

There are no issues that match your filters.

Category
Status