lib/old_tasks/bootstrap.rake

Summary

Maintainability
Test Coverage

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

namespace :db do
  desc "Load initial datamodel, then fixtures (in db/bootstrap/, but include default set here for ordering purposes) into the current environment's database.  Load specific fixtures using BOOTSTRAP_FIXTURES=x,y"
  task bootstrap: ['db:drop', 'db:create', 'db:bootstrap:load']
  namespace :bootstrap do
    desc 'Going back to VERSION 0 is currently broken for Kete, use db:drop the db:create instead.'
Severity: Minor
Found in lib/old_tasks/bootstrap.rake by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

  namespace :bootstrap do
    desc 'Going back to VERSION 0 is currently broken for Kete, use db:drop the db:create instead.'
    task rewind: :environment do
      # migrate back to the stone age
      ENV['VERSION'] = '0'
Severity: Minor
Found in lib/old_tasks/bootstrap.rake by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

TODO found
Open

  # TODO: Pull this after we upgrade from 1.2.3 to a later version of Rails
Severity: Minor
Found in lib/old_tasks/bootstrap.rake by fixme

Use self-assignment shorthand -=.
Open

        test_fixtures = test_fixtures - bootstrap_fixtures
Severity: Minor
Found in lib/old_tasks/bootstrap.rake by rubocop

This cop enforces the use the shorthand for self-assignment.

Example:

# bad
x = x + 1

# good
x += 1

Move Rake::Task['db:migrate'].invoke out of the conditional.
Open

        Rake::Task['db:migrate'].invoke
Severity: Minor
Found in lib/old_tasks/bootstrap.rake by rubocop

This cop checks for identical lines at the beginning or end of each branch of a conditional statement.

Example:

# bad
if condition
  do_x
  do_z
else
  do_y
  do_z
end

# good
if condition
  do_x
else
  do_y
end
do_z

# bad
if condition
  do_z
  do_x
else
  do_z
  do_y
end

# good
do_z
if condition
  do_x
else
  do_y
end

# bad
case foo
when 1
  do_x
when 2
  do_x
else
  do_x
end

# good
case foo
when 1
  do_x
  do_y
when 2
  # nothing
else
  do_x
  do_z
end

Move Rake::Task['db:migrate'].invoke out of the conditional.
Open

        Rake::Task['db:migrate'].invoke
Severity: Minor
Found in lib/old_tasks/bootstrap.rake by rubocop

This cop checks for identical lines at the beginning or end of each branch of a conditional statement.

Example:

# bad
if condition
  do_x
  do_z
else
  do_y
  do_z
end

# good
if condition
  do_x
else
  do_y
end
do_z

# bad
if condition
  do_z
  do_x
else
  do_z
  do_y
end

# good
do_z
if condition
  do_x
else
  do_y
end

# bad
case foo
when 1
  do_x
when 2
  do_x
else
  do_x
end

# good
case foo
when 1
  do_x
  do_y
when 2
  # nothing
else
  do_x
  do_z
end

There are no issues that match your filters.

Category
Status