Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubocop Offenses #250

Open
aaronmallen opened this issue Apr 20, 2016 · 0 comments
Open

Rubocop Offenses #250

aaronmallen opened this issue Apr 20, 2016 · 0 comments

Comments

@aaronmallen
Copy link

After changing implementing the following fix for #248:

#.rubocop.yml
Rails:
  Enabled: true
AllCops:
  Include:
    - '**/Gemfile'
    - '**/Rakefile'
  Exclude:
   - 'bin/*'
   - 'db/seeds.rb'
   - 'db/schema.rb'
   - 'vendor/bundle/**/*'

rubocop gives the following offenses:

$ rubocop
Inspecting 43 files
CCC.CCWC..CCCCC.CC..CC.CCCCCCCCCCCCCC.CC.C.

Offenses:

Gemfile:28:21: C: Use the new Ruby 1.9 hash syntax.
  gem 'rb-fchange', :require=>false
                    ^^^^^^^^^^
Gemfile:28:29: C: Surrounding space missing for operator =>.
  gem 'rb-fchange', :require=>false
                            ^^
Gemfile:29:21: C: Use the new Ruby 1.9 hash syntax.
  gem 'rb-fsevent', :require=>false
                    ^^^^^^^^^^
Gemfile:29:29: C: Surrounding space missing for operator =>.
  gem 'rb-fsevent', :require=>false
                            ^^
Gemfile:30:21: C: Use the new Ruby 1.9 hash syntax.
  gem 'rb-inotify', :require=>false
                    ^^^^^^^^^^
Gemfile:30:29: C: Surrounding space missing for operator =>.
  gem 'rb-inotify', :require=>false
                            ^^
Rakefile:2:81: C: Line is too long. [90/80]
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
                                                                                ^^^^^^^^^^
app/controllers/application_controller.rb:1:1: C: Missing top-level class documentation comment.
class ApplicationController < ActionController::Base
^^^^^
app/helpers/application_helper.rb:1:1: C: Missing top-level module documentation comment.
module ApplicationHelper
^^^^^^
app/models/user.rb:1:1: C: Missing top-level class documentation comment.
class User < ActiveRecord::Base
^^^^^
app/models/user.rb:3:39: C: Use the new Ruby 1.9 hash syntax.
  after_initialize :set_default_role, :if => :new_record?
                                      ^^^^^^
app/services/create_admin_service.rb:1:1: C: Missing top-level class documentation comment.
class CreateAdminService
^^^^^
app/services/create_admin_service.rb:3:5: W: Useless assignment to variable - user.
    user = User.find_or_create_by!(email: Rails.application.secrets.admin_email) do |user|
    ^^^^
app/services/create_admin_service.rb:3:81: C: Line is too long. [90/80]
    user = User.find_or_create_by!(email: Rails.application.secrets.admin_email) do |user|
                                                                                ^^^^^^^^^^
app/services/create_admin_service.rb:3:86: W: Shadowing outer local variable - user.
    user = User.find_or_create_by!(email: Rails.application.secrets.admin_email) do |user|
                                                                                     ^^^^
app/services/create_admin_service.rb:7:7: W: end at 7, 6 is not aligned with user = User.find_or_create_by!(email: Rails.application.secrets.admin_email) do |user| at 3, 4.
      end
      ^^^
config/application.rb:10:3: C: Missing top-level class documentation comment.
  class Application < Rails::Application
  ^^^^^
config/application.rb:11:1: C: Extra empty line detected at class body beginning.
config/application.rb:14:9: C: Align the parameters of a method call if they span more than one line.
        fixtures: true, ...
        ^^^^^^^^^^^^^^^
config/application.rb:20:49: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
      g.fixture_replacement :factory_girl, dir: "spec/factories"
                                                ^^^^^^^^^^^^^^^^
config/application.rb:23:81: C: Line is too long. [82/80]
    # Settings in config/environments/* take precedence over those specified here.
                                                                                ^^
config/application.rb:27:81: C: Line is too long. [99/80]
    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
                                                                                ^^^^^^^^^^^^^^^^^^^
config/application.rb:28:81: C: Line is too long. [89/80]
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
                                                                                ^^^^^^^^^
config/application.rb:31:81: C: Line is too long. [98/80]
    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
                                                                                ^^^^^^^^^^^^^^^^^^
config/application.rb:32:81: C: Line is too long. [87/80]
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
                                                                                ^^^^^^^
config/environments/development.rb:2:81: C: Line is too long. [85/80]
  # Settings specified here will take precedence over those in config/application.rb.
                                                                                ^^^^^
config/environments/development.rb:30:81: C: Line is too long. [82/80]
  # Asset digests allow you to set far-future HTTP expiration dates on all assets,
                                                                                ^^
config/environments/production.rb:2:81: C: Line is too long. [85/80]
  # Settings specified here will take precedence over those in config/application.rb.
                                                                                ^^^^^
config/environments/production.rb:34:81: C: Line is too long. [82/80]
  # Asset digests allow you to set far-future HTTP expiration dates on all assets,
                                                                                ^^
config/environments/production.rb:38:81: C: Line is too long. [102/80]
  # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
                                                                                ^^^^^^^^^^^^^^^^^^^^^^
config/environments/production.rb:44:81: C: Line is too long. [96/80]
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
                                                                                ^^^^^^^^^^^^^^^^
config/environments/production.rb:64:81: C: Line is too long. [100/80]
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
                                                                                ^^^^^^^^^^^^^^^^^^^^
config/environments/test.rb:2:81: C: Line is too long. [85/80]
  # Settings specified here will take precedence over those in config/application.rb.
                                                                                ^^^^^
config/initializers/assets.rb:10:81: C: Line is too long. [93/80]
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
                                                                                ^^^^^^^^^^^^^
config/initializers/backtrace_silencers.rb:3:81: C: Line is too long. [107/80]
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
config/initializers/backtrace_silencers.rb:6:81: C: Line is too long. [112/80]
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
config/initializers/devise.rb:9:81: C: Line is too long. [154/80]
  # config.secret_key = 'ef5d13cb79138d401b0d754c41811e6e226c204e378cdc33008b0d8efef5855df01406fee82090ce9f362f9bd4acc9e217c10ca14549347998e173d1065aae37'
                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
config/initializers/devise.rb:34:81: C: Line is too long. [83/80]
  # session. If you need permissions, you should implement that in a before filter.
                                                                                ^^^
config/initializers/devise.rb:39:81: C: Line is too long. [84/80]
  # Configure parameters from the request object used for authentication. Each entry
                                                                                ^^^^
config/initializers/devise.rb:41:81: C: Line is too long. [85/80]
  # find_for_authentication method and considered in your model lookup. For instance,
                                                                                ^^^^^
config/initializers/devise.rb:42:81: C: Line is too long. [88/80]
  # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
                                                                                ^^^^^^^^
config/initializers/devise.rb:43:81: C: Line is too long. [89/80]
  # The same considerations mentioned for authentication_keys also apply to request_keys.
                                                                                ^^^^^^^^^
config/initializers/devise.rb:53:81: C: Line is too long. [85/80]
  # modifying a user and when used to authenticate or find a user. Default is :email.
                                                                                ^^^^^
config/initializers/devise.rb:57:81: C: Line is too long. [81/80]
  # It can be set to an array that will enable params authentication only for the
                                                                                ^
config/initializers/devise.rb:58:81: C: Line is too long. [85/80]
  # given strategies, for example, `config.params_authenticatable = [:database]` will
                                                                                ^^^^^
config/initializers/devise.rb:64:81: C: Line is too long. [83/80]
  # given strategies, for example, `config.http_authenticatable = [:database]` will
                                                                                ^^^
config/initializers/devise.rb:66:81: C: Line is too long. [84/80]
  # :database      = Support basic authentication with authentication key + password
                                                                                ^^^^
config/initializers/devise.rb:95:81: C: Line is too long. [86/80]
  # using other algorithms, it sets how many times you want the password to be hashed.
                                                                                ^^^^^^
config/initializers/devise.rb:97:81: C: Line is too long. [82/80]
  # Limiting the stretches to just one in testing will increase the performance of
                                                                                ^^
config/initializers/devise.rb:99:81: C: Line is too long. [82/80]
  # a value less than 10 in other environments. Note that, for bcrypt (the default
                                                                                ^^
config/initializers/devise.rb:100:81: C: Line is too long. [83/80]
  # algorithm), the cost increases exponentially with the number of stretches (e.g.
                                                                                ^^^
config/initializers/devise.rb:101:81: C: Line is too long. [83/80]
  # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
                                                                                ^^^
config/initializers/devise.rb:105:81: C: Line is too long. [150/80]
  # config.pepper = 'bd3ade64e2c60d8b21434f5366a4dfc09d624ccd56e6f2508368b1072949317e687e6d8fb78ed81ac437ad99d0292bb80b2d82b6af1af902a303ec28ac8ed264'
                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
config/initializers/devise.rb:127:81: C: Line is too long. [86/80]
  # initial account confirmation) to be applied. Requires additional unconfirmed_email
                                                                                ^^^^^^
config/initializers/devise.rb:129:81: C: Line is too long. [84/80]
  # unconfirmed_email column, and copied to email column on successful confirmation.
                                                                                ^^^^
config/initializers/devise.rb:165:81: C: Line is too long. [85/80]
  # :failed_attempts = Locks an account after a number of failed attempts to sign in.
                                                                                ^^^^^
config/initializers/devise.rb:174:81: C: Line is too long. [83/80]
  # :time  = Re-enables login after a certain amount of time (see :unlock_in below)
                                                                                ^^^
config/initializers/devise.rb:199:81: C: Line is too long. [84/80]
  # When set to false, does not sign a user in automatically after their password is
                                                                                ^^^^
config/initializers/devise.rb:204:81: C: Line is too long. [86/80]
  # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
                                                                                ^^^^^^
config/initializers/devise.rb:206:81: C: Line is too long. [81/80]
  # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
                                                                                ^
config/initializers/devise.rb:214:81: C: Line is too long. [82/80]
  # Turn scoped views on. Before rendering "sessions/new", it will first check for
                                                                                ^^
config/initializers/devise.rb:248:81: C: Line is too long. [82/80]
  # change the failure app, you can configure them inside the config.warden block.
                                                                                ^^
config/initializers/devise.rb:256:81: C: Line is too long. [81/80]
  # When using Devise inside an engine, let's call it `MyEngine`, and this engine
                                                                                ^
config/initializers/filter_parameter_logging.rb:4:81: C: Line is too long. [81/80]
Rails.application.config.filter_parameters += [:password, :password_confirmation]
                                                                                ^
config/initializers/session_store.rb:3:81: C: Line is too long. [81/80]
Rails.application.config.session_store :cookie_store, key: '_blushing-co_session'
                                                                                ^
config/initializers/wrap_parameters.rb:6:81: C: Line is too long. [96/80]
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
                                                                                ^^^^^^^^^^^^^^^^
db/migrate/20160420015300_devise_create_users.rb:1:1: C: Missing top-level class documentation comment.
class DeviseCreateUsers < ActiveRecord::Migration
^^^^^
db/migrate/20160420015300_devise_create_users.rb:2:3: C: Method has too many lines. [15/10]
  def change ...
  ^^^^^^^^^^
db/migrate/20160420015300_devise_create_users.rb:5:59: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
      t.string :email,              null: false, default: ""
                                                          ^^
db/migrate/20160420015300_devise_create_users.rb:6:59: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
      t.string :encrypted_password, null: false, default: ""
                                                          ^^
db/migrate/20160420015300_devise_create_users.rb:29:81: C: Line is too long. [104/80]
      # t.integer  :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^
db/migrate/20160420015300_devise_create_users.rb:33:1: C: Extra blank line detected.
db/migrate/20160420015303_add_name_to_users.rb:1:1: C: Missing top-level class documentation comment.
class AddNameToUsers < ActiveRecord::Migration
^^^^^
db/migrate/20160420015309_add_role_to_users.rb:1:1: C: Missing top-level class documentation comment.
class AddRoleToUsers < ActiveRecord::Migration
^^^^^
spec/factories/users.rb:3:10: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
    name "Test User"
         ^^^^^^^^^^^
spec/factories/users.rb:4:11: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
    email "[email protected]"
          ^^^^^^^^^^^^^^^^^^
spec/factories/users.rb:5:14: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
    password "please123"
             ^^^^^^^^^^^
spec/factories/users.rb:10:1: C: Extra empty line detected at block body end.
spec/features/users/sign_in_spec.rb:6:1: C: Extra empty line detected at block body beginning.
spec/features/users/sign_in_spec.rb:13:81: C: Line is too long. [108/80]
    expect(page).to have_content I18n.t 'devise.failure.not_found_in_database', authentication_keys: 'email'
                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/features/users/sign_in_spec.rb:35:81: C: Line is too long. [108/80]
    expect(page).to have_content I18n.t 'devise.failure.not_found_in_database', authentication_keys: 'email'
                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/features/users/sign_in_spec.rb:46:81: C: Line is too long. [94/80]
    expect(page).to have_content I18n.t 'devise.failure.invalid', authentication_keys: 'email'
                                                                                ^^^^^^^^^^^^^^
spec/features/users/sign_in_spec.rb:48:1: C: Extra empty line detected at block body end.
spec/features/users/sign_out_spec.rb:6:1: C: Extra empty line detected at block body beginning.
spec/features/users/sign_out_spec.rb:18:1: C: Extra empty line detected at block body end.
spec/features/users/sign_out_spec.rb:20:1: C: 2 trailing blank lines detected.
spec/features/users/user_delete_spec.rb:9:1: C: Extra empty line detected at block body beginning.
spec/features/users/user_delete_spec.rb:21:20: C: Use the new Ruby 1.9 hash syntax.
    login_as(user, :scope => :user)
                   ^^^^^^^^^
spec/features/users/user_delete_spec.rb:27:1: C: Extra empty line detected at block body end.
spec/features/users/user_delete_spec.rb:29:1: C: 4 trailing blank lines detected.
spec/features/users/user_edit_spec.rb:9:1: C: Extra empty line detected at block body beginning.
spec/features/users/user_edit_spec.rb:20:20: C: Use the new Ruby 1.9 hash syntax.
    login_as(user, :scope => :user)
                   ^^^^^^^^^
spec/features/users/user_edit_spec.rb:22:22: C: Use the new Ruby 1.9 hash syntax.
    fill_in 'Email', :with => '[email protected]'
                     ^^^^^^^^
spec/features/users/user_edit_spec.rb:23:33: C: Use the new Ruby 1.9 hash syntax.
    fill_in 'Current password', :with => user.password
                                ^^^^^^^^
spec/features/users/user_edit_spec.rb:25:20: C: Space inside parentheses detected.
    txts = [I18n.t( 'devise.registrations.updated'), I18n.t( 'devise.registrations.update_needs_confirmation')]
                   ^
spec/features/users/user_edit_spec.rb:25:61: C: Space inside parentheses detected.
    txts = [I18n.t( 'devise.registrations.updated'), I18n.t( 'devise.registrations.update_needs_confirmation')]
                                                            ^
spec/features/users/user_edit_spec.rb:25:81: C: Line is too long. [111/80]
    txts = [I18n.t( 'devise.registrations.updated'), I18n.t( 'devise.registrations.update_needs_confirmation')]
                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/features/users/user_edit_spec.rb:36:18: C: Use the new Ruby 1.9 hash syntax.
    login_as(me, :scope => :user)
                 ^^^^^^^^^
spec/features/users/user_edit_spec.rb:41:1: C: Extra empty line detected at block body end.
spec/features/visitors/home_page_spec.rb:6:1: C: Extra empty line detected at block body beginning.
spec/features/visitors/home_page_spec.rb:15:1: C: Extra empty line detected at block body end.
spec/features/visitors/navigation_spec.rb:6:1: C: Extra empty line detected at block body beginning.
spec/features/visitors/navigation_spec.rb:17:1: C: Extra empty line detected at block body end.
spec/features/visitors/sign_up_spec.rb:6:1: C: Extra empty line detected at block body beginning.
spec/features/visitors/sign_up_spec.rb:13:20: C: Space inside parentheses detected.
    txts = [I18n.t( 'devise.registrations.signed_up'), I18n.t( 'devise.registrations.signed_up_but_unconfirmed')]
                   ^
spec/features/visitors/sign_up_spec.rb:13:63: C: Space inside parentheses detected.
    txts = [I18n.t( 'devise.registrations.signed_up'), I18n.t( 'devise.registrations.signed_up_but_unconfirmed')]
                                                              ^
spec/features/visitors/sign_up_spec.rb:13:81: C: Line is too long. [113/80]
    txts = [I18n.t( 'devise.registrations.signed_up'), I18n.t( 'devise.registrations.signed_up_but_unconfirmed')]
                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/features/visitors/sign_up_spec.rb:41:34: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
    expect(page).to have_content "Password is too short"
                                 ^^^^^^^^^^^^^^^^^^^^^^^
spec/features/visitors/sign_up_spec.rb:61:1: C: Extra empty line detected at block body end.
spec/models/user_spec.rb:2:1: C: Extra empty line detected at block body beginning.
spec/models/user_spec.rb:9:6: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
  it "#email returns a string" do
     ^^^^^^^^^^^^^^^^^^^^^^^^^
spec/models/user_spec.rb:12:1: C: Extra empty line detected at block body end.
spec/rails_helper.rb:5:7: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
abort("The Rails environment is running in production mode!") if Rails.env.production?
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/rails_helper.rb:5:81: C: Line is too long. [86/80]
abort("The Rails environment is running in production mode!") if Rails.env.production?
                                                                                ^^^^^^
spec/spec_helper.rb:1:81: C: Line is too long. [92/80]
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
                                                                                ^^^^^^^^^^^^
spec/spec_helper.rb:45:1: C: Do not use block comments.
=begin ...
^^^^^^
spec/support/database_cleaner.rb:10:24: C: Use the new Ruby 1.9 hash syntax.
  config.before(:each, :js => true) do
                       ^^^^^^
spec/support/devise.rb:2:39: C: Use the new Ruby 1.9 hash syntax.
  config.include Devise::TestHelpers, :type => :controller
                                      ^^^^^^^^
spec/support/helpers/session_helpers.rb:7:40: C: Use the new Ruby 1.9 hash syntax.
      fill_in 'Password confirmation', :with => confirmation
                                       ^^^^^^^^

43 files inspected, 119 offenses detected

rails composer config:

option  Build a starter application?
choose  Enter your selection: [none]
option  Get on the mailing list for Rails Composer news?
choose  Enter your selection: [none]
option  Web server for development?
choose  Enter your selection: [thin]
option  Web server for production?
choose  Enter your selection: [puma]
option  Database used in development?
choose  Enter your selection: [postgresql]
option  Template engine?
choose  Enter your selection: [slim]
option  Test framework?
choose  Enter your selection: [rspec]
option  Continuous testing?
choose  Enter your selection: [guard]
option  Front-end framework?
choose  Enter your selection: [bootstrap3]
option  Add support for sending email?
choose  Enter your selection: [none]
option  Authentication?
choose  Enter your selection: [devise]
option  Devise modules?
choose  Enter your selection: [default]
option  OmniAuth provider?
choose  Enter your selection: []
option  Authorization?
choose  Enter your selection: [roles]
option  Use a form builder gem?
choose  Enter your selection: [none]
option  Add pages?
choose  Enter your selection: [home]
option  Set a locale?
choose  Enter your selection: [none]
option  Install page-view analytics?
choose  Enter your selection: [none]
option  Add a deployment mechanism?
choose  Enter your selection: [none]
option  Set a robots.txt file to ban spiders?
choose  Enter your selection: [true]
option  Create a GitHub repository? (y/n)
choose  Enter your selection: []
option  Add gem and file for environment variables?
choose  Enter your selection: [figaro]
option  Reduce assets logger noise during development?
choose  Enter your selection: [true]
option  Improve error reporting with 'better_errors' during development?
choose  Enter your selection: [true]
option  Use 'pry' as console replacement during development and test?
choose  Enter your selection: [true]
option  Use or create a project-specific rvm gemset?
choose  Enter your selection: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant