ChaelCodes/HuntersKeepers

View on GitHub
lib/tasks/data.rake

Summary

Maintainability
Test Coverage

Avoid using update_all because it skips validations.
Wontfix

      playbooks.update_all('backstory = config')
Severity: Minor
Found in lib/tasks/data.rake by rubocop

This cop checks for the use of methods which skip validations which are listed in https://guides.rubyonrails.org/active_record_validations.html#skipping-validations

Methods may be ignored from this rule by configuring a Whitelist.

Example:

# bad
Article.first.decrement!(:view_count)
DiscussionBoard.decrement_counter(:post_count, 5)
Article.first.increment!(:view_count)
DiscussionBoard.increment_counter(:post_count, 5)
person.toggle :active
product.touch
Billing.update_all("category = 'authorized', author = 'David'")
user.update_attribute(:website, 'example.com')
user.update_columns(last_request_at: Time.current)
Post.update_counters 5, comment_count: -1, action_count: 1

# good
user.update(website: 'example.com')
FileUtils.touch('file')

Example: Whitelist: ["touch"]

# bad
DiscussionBoard.decrement_counter(:post_count, 5)
DiscussionBoard.increment_counter(:post_count, 5)
person.toggle :active

# good
user.touch

Line is too long. [109/80]
Wontfix

      .update_all(description: 'Retire this hunter to safety.', # rubocop:disable Rails/SkipsModelValidations
Severity: Minor
Found in lib/tasks/data.rake by rubocop

Line is too long. [81/80]
Wontfix

    Improvement.where("created_at >  to_timestamp('15 Feb 2021', 'DD Mon YYYY')")
Severity: Minor
Found in lib/tasks/data.rake by rubocop

There are no issues that match your filters.

Category
Status