Skip to content

Instantly share code, notes, and snippets.

@mlafeldt
Last active August 29, 2015 13:55
Show Gist options
  • Save mlafeldt/8772223 to your computer and use it in GitHub Desktop.
Save mlafeldt/8772223 to your computer and use it in GitHub Desktop.
RuboCop offences for Practicing Ruby Rails app
Inspecting 166 files
CCCCCCCCCCCCCCWWCCCCCCCCCCCCCCCCWCCCCCCCCWCCCCCCCCCW.C..C.CCCCC.C..CCC.C.CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCWC.WCC..CC.WWCCCCWCCCWCCCCCCCCCWCCCCCCCWWCCC
Offences:
app/controllers/admin/announcements_controller.rb:1:1: C: Missing top-level class documentation comment.
class Admin::AnnouncementsController < ApplicationController
^^^^^
app/controllers/admin/announcements_controller.rb:18:29: C: Missing space after #.
redirect_to root_path #announcement_path(@announcement)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/announcements_controller.rb:25:1: C: Extra blank line detected at body beginning.
app/controllers/admin/announcements_controller.rb:25:1: C: Extra blank line detected at body end.
app/controllers/admin/announcements_controller.rb:31:29: C: Missing space after #.
redirect_to root_path #announcement_path(@announcement)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/articles_controller.rb:2:3: C: Missing top-level class documentation comment.
class ArticlesController < ApplicationController
^^^^^
app/controllers/admin/articles_controller.rb:26:1: C: Extra blank line detected at body beginning.
app/controllers/admin/articles_controller.rb:26:1: C: Extra blank line detected at body end.
app/controllers/admin/broadcasts_controller.rb:2:3: C: Missing top-level class documentation comment.
class BroadcastsController < ApplicationController
^^^^^
app/controllers/admin/broadcasts_controller.rb:6:1: C: Extra blank line detected at body beginning.
app/controllers/admin/broadcasts_controller.rb:6:1: C: Extra blank line detected at body end.
app/controllers/admin/broadcasts_controller.rb:9:5: C: Method has too many lines. [14/10]
def create
^^^
app/controllers/admin/broadcasts_controller.rb:28:1: C: Extra blank line detected at body end.
app/controllers/admin/magic_controller.rb:1:1: C: Missing top-level class documentation comment.
class Admin::MagicController < ApplicationController
^^^^^
app/controllers/admin/magic_controller.rb:26:1: C: Extra blank line detected at body end.
app/controllers/admin/reports_controller.rb:2:3: C: Missing top-level class documentation comment.
class ReportsController < ApplicationController
^^^^^
app/controllers/announcements_controller.rb:1:1: C: Missing top-level class documentation comment.
class AnnouncementsController < ApplicationController
^^^^^
app/controllers/application_controller.rb:1:1: C: Missing top-level class documentation comment.
class ApplicationController < ActionController::Base
^^^^^
app/controllers/application_controller.rb:15:61: C: Place the . on the next line, together with the method name.
@current_authorization = Authorization.includes(:user).
^
app/controllers/application_controller.rb:29:80: C: Line is too long. [85/79]
flash[:notice] = "That page is protected. Please log in or subscribe to continue"
^^^^^^
app/controllers/application_controller.rb:49:80: C: Line is too long. [83/79]
@current_authorization ||= Authorization.find_by_id(session[:authorization_id])
^^^^
app/controllers/application_controller.rb:80:80: C: Line is too long. [84/79]
Announcement.broadcasts.where("id NOT IN (?)", session[:dismissed_broadcasts])
^^^^^
app/controllers/articles_controller.rb:1:1: C: Missing top-level class documentation comment.
class ArticlesController < ApplicationController
^^^^^
app/controllers/articles_controller.rb:14:72: C: Place the . on the next line, together with the method name.
@random = @articles.where(:recommended => false).all.sample(5).
^
app/controllers/articles_controller.rb:18:1: C: Extra blank line detected.
app/controllers/articles_controller.rb:59:80: C: Line is too long. [83/79]
# NOTE: This method uses our custom override of article_path in ApplicationHelper
^^^^
app/controllers/articles_controller.rb:62:80: C: Line is too long. [80/79]
slug_needs_updating = @article.slug.present? && params[:id] != @article.slug
^
app/controllers/articles_controller.rb:70:80: C: Line is too long. [91/79]
unless params[:u].present? && User.find_by_share_token_and_status(params[:u], "active")
^^^^^^^^^^^^
app/controllers/comments_controller.rb:1:1: C: Missing top-level class documentation comment.
class CommentsController < ApplicationController
^^^^^
app/controllers/comments_controller.rb:7:3: C: Method has too many lines. [11/10]
def create
^^^
app/controllers/home_controller.rb:1:1: C: Missing top-level class documentation comment.
class HomeController < ApplicationController
^^^^^
app/controllers/home_controller.rb:2:3: C: Method has too many lines. [14/10]
def public_archives
^^^
app/controllers/home_controller.rb:11:1: C: Extra blank line detected.
app/controllers/hooks_controller.rb:1:1: C: Missing top-level class documentation comment.
class HooksController < ApplicationController
^^^^^
app/controllers/sessions_controller.rb:1:1: C: Missing top-level class documentation comment.
class SessionsController < ApplicationController
^^^^^
app/controllers/sessions_controller.rb:13:3: C: Method has too many lines. [15/10]
def create
^^^
app/controllers/sessions_controller.rb:23:9: C: Align the elements of a hash literal if they span more than one line.
:github_nickname => auth["info"]["nickname"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/sessions_controller.rb:45:1: C: Extra blank line detected at body end.
app/controllers/subscriptions_controller.rb:1:1: C: Missing top-level class documentation comment.
class SubscriptionsController < ApplicationController
^^^^^
app/controllers/subscriptions_controller.rb:8:7: C: Align the elements of an array literal if they span more than one line.
payment_pending].include? current_user.try(:status)
^^^^^^^^^^^^^^^
app/controllers/user_email_controller.rb:1:1: C: Missing top-level class documentation comment.
class UserEmailController < ApplicationController
^^^^^
app/controllers/user_email_controller.rb:29:5: C: Favor unless (or control flow or) over if for negative conditions.
RegistrationMailer.email_confirmation(@user).deliver if !changed
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/users_controller.rb:1:1: C: Missing top-level class documentation comment.
class UsersController < ApplicationController
^^^^^
app/controllers/users_controller.rb:9:5: C: Provide an exception class and message as arguments to raise.
raise ActionController::RoutingError.new('Not Found') unless @user
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/users_controller.rb:23:5: C: Redundant `begin` block detected.
begin
^^^^^
app/controllers/users_controller.rb:50:80: C: Line is too long. [80/79]
flash[:notice] = "You have sucessfully changed to #{new_interval}ly billing"
^
app/controllers/users_controller.rb:71:5: W: end at 71, 4 is not aligned with message = if at 67, 14
end
^^^
app/controllers/users_controller.rb:83:80: C: Line is too long. [81/79]
approved_params = %w{notify_conversations notify_mentions notify_comment_made
^^
app/controllers/users_controller.rb:84:7: C: Align the elements of an array literal if they span more than one line.
beta_tester contact_email notify_updates}
^^^^^^^^^^^
app/controllers/users_controller.rb:86:26: C: Space between { and | missing.
params[:user].select {|k,_| approved_params.include? k }
^^
app/controllers/users_controller.rb:86:29: C: Space missing after comma.
params[:user].select {|k,_| approved_params.include? k }
^
app/decorators/article_decorator.rb:1:1: C: Missing top-level class documentation comment.
class ArticleDecorator < Draper::Decorator
^^^^^
app/decorators/article_decorator.rb:14:24: C: Surrounding space missing in default value assignment.
def list_link(options={:text => list_title})
^
app/decorators/article_decorator.rb:14:25: C: Space inside { missing.
def list_link(options={:text => list_title})
^
app/decorators/article_decorator.rb:14:45: C: Space inside } missing.
def list_link(options={:text => list_title})
^
app/decorators/article_decorator.rb:20:5: W: end at 20, 4 is not aligned with path = if at 16, 11
end
^^^
app/decorators/collection_decorator.rb:1:1: C: Missing top-level class documentation comment.
class CollectionDecorator < Draper::Decorator
^^^^^
app/decorators/collection_decorator.rb:6:7: C: Align the parameters of a method call if they span more than one line.
h.image_tag("icons/#{name}"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/decorators/collection_decorator.rb:7:7: C: Align the parameters of a method call if they span more than one line.
:class => 'icon collection'
^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/decorators/collection_decorator.rb:13:8: C: Space inside square brackets detected.
[ icon, collection.name ].join("\n").html_safe
^
app/decorators/collection_decorator.rb:13:30: C: Space inside square brackets detected.
[ icon, collection.name ].join("\n").html_safe
^
app/decorators/comment_decorator.rb:1:1: C: Missing top-level class documentation comment.
class CommentDecorator < Draper::Decorator
^^^^^
app/decorators/comment_decorator.rb:11:8: C: Space inside square brackets detected.
[ h.link_to('Edit', '#', :class => "edit", :title => "Edit"),
^
app/decorators/comment_decorator.rb:13:11: C: Align the parameters of a method call if they span more than one line.
:class => "remove", :title => "Delete",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/decorators/comment_decorator.rb:15:80: C: Line is too long. [83/79]
:data => { :confirm => "Do you really want to delete this comment?" })
^^^^
app/decorators/subscription_decorator.rb:1:1: C: Missing top-level class documentation comment.
class SubscriptionDecorator < Draper::Decorator
^^^^^
app/decorators/subscription_decorator.rb:19:3: C: Method has too many lines. [17/10]
def change_billing_interval_message
^^^
app/decorators/subscription_decorator.rb:35:9: C: Align the parameters of a method call if they span more than one line.
h.change_billing_interval_user_path(h.current_user,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/decorators/subscription_decorator.rb:36:11: C: Align the parameters of a method call if they span more than one line.
:interval => alternate_billing_interval),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/decorators/subscription_decorator.rb:37:9: C: Align the parameters of a method call if they span more than one line.
:class => 'btn', :method => 'post'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/decorators/user_decorator.rb:1:1: C: Missing top-level class documentation comment.
class UserDecorator < Draper::Decorator
^^^^^
app/decorators/user_decorator.rb:8:16: C: Surrounding space missing in default value assignment.
def icon(size=32, options={})
^
app/decorators/user_decorator.rb:8:28: C: Surrounding space missing in default value assignment.
def icon(size=32, options={})
^
app/decorators/user_decorator.rb:13:80: C: Line is too long. [80/79]
default = CGI.escape("http://#{h.request.host_with_port}#{image_path}")
^
app/decorators/user_decorator.rb:14:80: C: Line is too long. [83/79]
image_path = "https://www.gravatar.com/avatar/#{hash}?s=#{size}&d=#{default}"
^^^^
app/decorators/user_decorator.rb:21:7: C: Align the elements of a hash literal if they span more than one line.
:style => "width: #{size}px; height: #{size}px;", :class => "user-icon"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/decorators/volume_decorator.rb:1:1: C: Missing top-level class documentation comment.
class VolumeDecorator < Draper::Decorator
^^^^^
app/decorators/volume_decorator.rb:6:8: C: Space inside square brackets detected.
[ icon, volume.name ].join("\n").html_safe
^
app/decorators/volume_decorator.rb:6:26: C: Space inside square brackets detected.
[ icon, volume.name ].join("\n").html_safe
^
app/helpers/application_helper.rb:1:1: C: Missing top-level module documentation comment.
module ApplicationHelper
^^^^^^
app/helpers/application_helper.rb:17:3: C: Method has too many lines. [11/10]
def error_messages_for(object)
^^^
app/helpers/application_helper.rb:21:80: C: Line is too long. [94/79]
content_tag(:p) { "Please review the form below and make the appropriate changes." } +
^^^^^^^^^^^^^^^
app/helpers/article_helper.rb:1:1: C: Missing top-level module documentation comment.
module ArticleHelper
^^^^^^
app/helpers/article_helper.rb:2:34: C: Surrounding space missing in default value assignment.
def article_url(article, params={})
^
app/helpers/article_helper.rb:8:35: C: Surrounding space missing in default value assignment.
def article_path(article, params={})
^
app/mailers/account_mailer.rb:1:1: C: Missing top-level class documentation comment.
class AccountMailer < ActionMailer::Base
^^^^^
app/mailers/account_mailer.rb:21:80: C: Line is too long. [92/79]
:subject => "There was a problem with your payment for Practicing Ruby :(").deliver
^^^^^^^^^^^^^
app/mailers/account_mailer.rb:45:80: C: Line is too long. [82/79]
:subject => "[Practicing Ruby] Mailchimp yearly billing request").deliver
^^^
app/mailers/broadcast_mailer.rb:1:1: C: Missing top-level class documentation comment.
class BroadcastMailer < ActionMailer::Base
^^^^^
app/mailers/conversation_mailer.rb:1:1: C: Missing top-level class documentation comment.
class ConversationMailer < ActionMailer::Base
^^^^^
app/mailers/registration_mailer.rb:1:1: C: Missing top-level class documentation comment.
class RegistrationMailer < ActionMailer::Base
^^^^^
app/models/announcement.rb:1:1: C: Missing top-level class documentation comment.
class Announcement < ActiveRecord::Base
^^^^^
app/models/article.rb:1:1: C: Missing top-level class documentation comment.
class Article < ActiveRecord::Base
^^^^^
app/models/article.rb:23:22: C: Use %w or %W for array of words.
where(:status => ["published", "public"])
^^^^^^^^^^^^^^^^^^^^^^^
app/models/article_link.rb:1:1: C: Missing top-level class documentation comment.
class ArticleLink
^^^^^
app/models/article_link.rb:4:33: C: Surrounding space missing in default value assignment.
def initialize(article, params={})
^
app/models/article_link.rb:22:5: C: Space inside { missing.
{:u => token}.merge(params)
^
app/models/article_link.rb:22:17: C: Space inside } missing.
{:u => token}.merge(params)
^
app/models/article_visit.rb:1:1: C: Missing top-level class documentation comment.
class ArticleVisit < ActiveRecord::Base
^^^^^
app/models/authorization.rb:1:1: C: Missing top-level class documentation comment.
class Authorization < ActiveRecord::Base
^^^^^
app/models/authorization_link.rb:1:1: C: Missing top-level class documentation comment.
class AuthorizationLink < ActiveRecord::Base
^^^^^
app/models/authorization_link.rb:10:3: C: Method has too many lines. [12/10]
def self.activate(key)
^^^
app/models/authorization_link.rb:11:13: W: Assignment in condition - you probably meant to use ==.
if link = find_by_secret(key)
^
app/models/broadcaster.rb:1:1: C: Missing top-level class documentation comment.
class Broadcaster
^^^^^
app/models/broadcaster.rb:9:58: C: Trailing whitespace detected.
subscriber = Struct.new(:contact_email, :share_token)
^^
app/models/card_expirer.rb:1:15: C: Use the lambda method for multi-line lambdas.
CardExpirer = ->(date) {
^^
app/models/card_expirer.rb:1:24: C: Avoid using {...} for multi-line blocks.
CardExpirer = ->(date) {
^
app/models/collection.rb:1:1: C: Missing top-level class documentation comment.
class Collection < ActiveRecord::Base
^^^^^
app/models/comment.rb:1:1: C: Missing top-level class documentation comment.
class Comment < ActiveRecord::Base
^^^^^
app/models/comment.rb:10:55: C: Space between { and | missing.
mentions = body.scan(/@([a-z\d-]+)/i).flatten.map {|m| m.downcase }
^^
app/models/conversation_notifier.rb:1:1: C: Missing top-level class documentation comment.
class ConversationNotifier
^^^^^
app/models/conversation_notifier.rb:18:65: C: Trailing whitespace detected.
ConversationMailer.comment_made(comment, comment_watchers)
^
app/models/credit_card.rb:1:1: C: Missing top-level class documentation comment.
class CreditCard < ActiveRecord::Base
^^^^^
app/models/credit_card.rb:7:3: C: Source files should end with a newline (\n).
end
^
app/models/payment.rb:1:1: C: Missing top-level class documentation comment.
class Payment < ActiveRecord::Base
^^^^^
app/models/payment_gateway/mail_chimp.rb:2:3: C: Missing top-level class documentation comment.
class MailChimp
^^^^^
app/models/payment_gateway/mail_chimp.rb:3:1: C: Extra blank line detected at body beginning.
app/models/payment_gateway/mail_chimp.rb:12:3: C: Source files should end with a newline (\n).
end
^
app/models/payment_gateway/stripe.rb:2:3: C: Class definition is too long. [138/100]
class Stripe
^^^^^
app/models/payment_gateway/stripe.rb:2:3: C: Missing top-level class documentation comment.
class Stripe
^^^^^
app/models/payment_gateway/stripe.rb:3:1: C: Extra blank line detected at body beginning.
app/models/payment_gateway/stripe.rb:23:47: W: Useless assignment to variable - e
rescue ::Stripe::InvalidRequestError => e
^
app/models/payment_gateway/stripe.rb:28:5: C: Method has too many lines. [25/10]
def subscribe(params = {})
^^^
app/models/payment_gateway/stripe.rb:32:19: W: Assignment in condition - you probably meant to use ==.
if customer = find_customer
^
app/models/payment_gateway/stripe.rb:105:70: C: Place the . on the next line, together with the method name.
payment = user.payments.where(:stripe_invoice_id => invoice.id).
^
app/models/payment_gateway.rb:1:1: C: Missing top-level module documentation comment.
module PaymentGateway
^^^^^^
app/models/payment_gateway.rb:2:1: C: Extra blank line detected at body beginning.
app/models/payment_gateway.rb:3:5: C: Annotation keywords should be all upper case, followed by a colon and a space, then a note describing the problem.
# TODO Enable MailChimp
^^^^
app/models/payment_gateway.rb:7:1: C: Extra blank line detected at body end.
app/models/payment_gateway.rb:8:3: C: Source files should end with a newline (\n).
end
^
app/models/payment_log.rb:1:1: C: Missing top-level class documentation comment.
class PaymentLog < ActiveRecord::Base
^^^^^
app/models/payment_log.rb:3:3: C: Source files should end with a newline (\n).
end
^
app/models/reports.rb:9:80: C: Line is too long. [82/79]
Subscription.where("finish_date is null and payment_provider <> 'free'").count
^^^
app/models/reports.rb:11:1: C: Trailing whitespace detected.
app/models/reports.rb:14:80: C: Line is too long. [109/79]
.where("finish_date is null and payment_provider <> 'free' and start_date > ?", Date.today-7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/reports.rb:14:107: C: Surrounding space missing for operator '-'.
.where("finish_date is null and payment_provider <> 'free' and start_date > ?", Date.today-7)
^
app/models/reports.rb:15:80: C: Line is too long. [82/79]
.map { |e| "#{e.user.contact_email} (#{e.user.github_nickname})" }
^^^
app/models/reports.rb:20:80: C: Line is too long. [86/79]
.where("finish_date > ? and payment_provider <> 'free'", Date.today-7)
^^^^^^^
app/models/reports.rb:20:84: C: Surrounding space missing for operator '-'.
.where("finish_date > ? and payment_provider <> 'free'", Date.today-7)
^
app/models/reports.rb:21:80: C: Line is too long. [82/79]
.map { |e| "#{e.user.contact_email} (#{e.user.github_nickname})" }
^^^
app/models/reports.rb:24:1: C: Extra blank line detected.
app/models/reports.rb:24:1: C: Extra blank line detected at body end.
app/models/secret_generator.rb:1:1: C: Missing top-level module documentation comment.
module SecretGenerator
^^^^^^
app/models/secret_generator.rb:2:3: C: Use `module_function` instead of `extend self`.
extend self
^^^^^^^^^^^
app/models/secret_generator.rb:4:22: C: Surrounding space missing in default value assignment.
def generate(length=30)
^
app/models/secret_generator.rb:5:21: C: Space missing to the left of {.
(0...length).map{ ('a'..'z').to_a[rand(26)] }.join
^
app/models/secret_generator.rb:7:3: C: Source files should end with a newline (\n).
end
^
app/models/shared_article.rb:1:1: C: Missing top-level class documentation comment.
class SharedArticle < ActiveRecord::Base
^^^^^
app/models/subscription.rb:1:1: C: Missing top-level class documentation comment.
class Subscription < ActiveRecord::Base
^^^^^
app/models/user.rb:1:1: C: Missing top-level class documentation comment.
class User < ActiveRecord::Base
^^^^^
app/models/user.rb:2:80: C: Line is too long. [80/79]
STATUSES = %w{authorized pending_confirmation confirmed payment_pending
^
app/models/user.rb:23:80: C: Line is too long. [88/79]
# http://ar.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M000087
^^^^^^^^^
app/models/user.rb:26:5: C: Align the parameters of a method call if they span more than one line.
:with => /\A\s*([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\s*\Z/i,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/user.rb:66:30: C: Surrounding space missing in default value assignment.
def enable(mailchimp_web_id=nil)
^
app/models/user.rb:67:7: C: Annotation keywords should be all upper case, followed by a colon and a space, then a note describing the problem.
# TODO Move this to PaymentGateway
^^^^
app/models/user_manager.rb:1:1: C: Missing top-level class documentation comment.
class UserManager
^^^^^
app/models/user_manager.rb:19:80: C: Line is too long. [96/79]
client.list_members(:id => list_id, :status => "unsubscribed")["data"].map {|u| u["email"] }
^^^^^^^^^^^^^^^^^
app/models/user_manager.rb:19:80: C: Space between { and | missing.
client.list_members(:id => list_id, :status => "unsubscribed")["data"].map {|u| u["email"] }
^^
app/models/volume.rb:1:1: C: Missing top-level class documentation comment.
class Volume < ActiveRecord::Base
^^^^^
app/models/volume.rb:3:1: C: Trailing whitespace detected.
config/application.rb:5:17: W: `*' interpreted as argument prefix
Bundler.require *Rails.groups(:assets => %w(development test))
^
config/application.rb:8:3: C: Missing top-level class documentation comment.
class Application < Rails::Application
^^^^^
config/application.rb:23:80: C: Line is too long. [82/79]
# Settings in config/environments/* take precedence over those specified here.
^^^
config/application.rb:30:80: C: Line is too long. [85/79]
# Only load the plugins named here, in the order given (default is alphabetical).
^^^^^^
config/application.rb:35:80: C: Line is too long. [83/79]
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
^^^^
config/application.rb:37:80: C: Line is too long. [99/79]
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
^^^^^^^^^^^^^^^^^^^^
config/application.rb:38:80: C: Line is too long. [89/79]
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
^^^^^^^^^^
config/application.rb:41:80: C: Line is too long. [98/79]
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
^^^^^^^^^^^^^^^^^^^
config/application.rb:42:80: C: Line is too long. [87/79]
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
^^^^^^^^
config/application.rb:46:80: C: Line is too long. [81/79]
# JavaScript files you want as :defaults (application.js is always included).
^^
config/application.rb:61:80: C: Line is too long. [86/79]
ActionMailer::Base.default :from => "Practicing Ruby <[email protected]>"
^^^^^^^
config/deploy/old_production.rb:11:1: C: 1 trailing blank lines detected.
config/deploy.rb:13:80: C: Line is too long. [82/79]
set :repository, "https://github.com/elm-city-craftworks/practicing-ruby-web.git"
^^^
config/deploy.rb:15:14: C: Avoid the use of Perl-style backrefs.
set :branch, $1 if `git branch` =~ /\* (\S+)\s/m
^^
config/deploy.rb:64:80: C: Line is too long. [96/79]
load_articles = "bzcat tmp/#{file} | psql -U#{local_db['username']} #{local_db['database']}"
^^^^^^^^^^^^^^^^^
config/deploy.rb:76:23: C: Surrounding space missing in default value assignment.
def database_config(db="development")
^
config/deploy.rb:77:7: C: Do not use :: for method calls.
YAML::load_file('config/database.yml')[db]
^^
config/deploy.rb:80:30: C: Surrounding space missing in default value assignment.
def remote_database_config(db="production")
^
config/deploy.rb:82:7: C: Do not use :: for method calls.
YAML::load(remote_config)[db]
^^
config/deploy.rb:85:26: C: Surrounding space missing in default value assignment.
def run_rake(cmd, options={}, &block)
^
config/deploy.rb:86:80: C: Line is too long. [98/79]
command = "cd #{current_release} && /usr/bin/env bundle exec rake #{cmd} RAILS_ENV=#{rails_env}"
^^^^^^^^^^^^^^^^^^^
config/environments/development.rb:2:80: C: Line is too long. [84/79]
# Settings specified here will take precedence over those in config/application.rb
^^^^^
config/environments/development.rb:5:80: C: Line is too long. [80/79]
# every request. This slows down response time but is perfect for development
^
config/environments/development.rb:31:1: C: 1 trailing blank lines detected.
config/environments/production.rb:2:80: C: Line is too long. [84/79]
# Settings specified here will take precedence over those in config/application.rb
^^^^^
config/environments/test.rb:2:80: C: Line is too long. [84/79]
# Settings specified here will take precedence over those in config/application.rb
^^^^^
config/environments/test.rb:29:80: C: Line is too long. [85/79]
# Use SQL instead of Active Record's schema dumper when creating the test database.
^^^^^^
config/environments/test.rb:30:80: C: Line is too long. [85/79]
# This is necessary if your schema can't be completely dumped by the schema dumper,
^^^^^^
config/initializers/backtrace_silencers.rb:3:80: C: Line is too long. [107/79]
# 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:80: C: Line is too long. [112/79]
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
config/initializers/cache_cooker_settings.rb:2:80: C: Line is too long. [83/79]
CacheCooker.digest_auth ENV["CACHE_COOKER_USERNAME"], ENV["CACHE_COOKER_PASSWORD"]
^^^^
config/initializers/exception_notifier.rb:3:5: C: Align the parameters of a method call if they span more than one line.
:email_prefix => "[Practicing Ruby] ",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
config/initializers/exception_notifier.rb:5:80: C: Line is too long. [82/79]
:exception_recipients => %w{[email protected] [email protected]},
^^^
config/initializers/exception_notifier.rb:6:80: C: Line is too long. [104/79]
:ignore_exceptions => [ActionView::MissingTemplate] + ExceptionNotifier.default_ignore_exceptions
^^^^^^^^^^^^^^^^^^^^^^^^^
config/initializers/mailchimp_settings.rb:1:1: C: Use SCREAMING_SNAKE_CASE for constants.
MailChimpSettings = {
^^^^^^^^^^^^^^^^^
config/initializers/mailchimp_settings.rb:1:22: C: Trailing whitespace detected.
MailChimpSettings = {
^
config/initializers/mailchimp_settings.rb:4:48: C: Trailing whitespace detected.
:webhook_key => ENV["MAILCHIMP_WEBHOOK_KEY"]
^
config/initializers/mailhopper.rb:3:3: C: Source files should end with a newline (\n).
end
^
config/initializers/markdown.rb:2:3: C: Missing top-level module documentation comment.
module CustomParser
^^^^^^
config/initializers/markdown.rb:3:5: C: Use `module_function` instead of `extend self`.
extend self
^^^^^^^^^^^
config/initializers/markdown.rb:7:9: C: Align the parameters of a method call if they span more than one line.
:autolink => true,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
config/initializers/markdown.rb:25:3: C: Source files should end with a newline (\n).
end
^
config/initializers/omniauth.rb:6:69: C: Trailing whitespace detected.
provider :github, ENV["GITHUB_CLIENT_KEY"], ENV["GITHUB_SECRET"]
^
config/initializers/session_store.rb:3:80: C: Line is too long. [105/79]
PracticingRubyWeb::Application.config.session_store :cookie_store, :key => '_practicing-ruby-web_session'
^^^^^^^^^^^^^^^^^^^^^^^^^^
config/initializers/stripe.rb:3:80: C: Line is too long. [80/79]
STRIPE_WEBHOOK_PATH = ENV["TRAVIS"] ? "a/b/c/d" : ENV["STRIPE_WEBHOOK_PATH"]
^
config/initializers/stripe.rb:3:80: C: Trailing whitespace detected.
STRIPE_WEBHOOK_PATH = ENV["TRAVIS"] ? "a/b/c/d" : ENV["STRIPE_WEBHOOK_PATH"]
^
config/initializers/stripe_webhooks.rb:27:3: C: Source files should end with a newline (\n).
end
^
config/routes.rb:7:80: C: Line is too long. [80/79]
match '/articles/shared/:secret' => 'articles#shared', :as => "shared_article"
^
config/routes.rb:37:80: C: Line is too long. [83/79]
resources :subscriptions, :except => [:index, :destroy, :edit, :update, :show] do
^^^^
config/routes.rb:50:80: C: Line is too long. [85/79]
match '/dismiss_broadcasts' => 'announcements#dismiss', :as => 'dismiss_broadcasts'
^^^^^^
config/routes.rb:57:80: C: Line is too long. [80/79]
get 'notifications' => 'users#notifications', :as => 'notification_settings'
^
config/routes.rb:62:7: C: Align the elements of a hash literal if they span more than one line.
:as => 'update_credit_card'
^^^^^^^^^^^^^^^^^^^^^^^^^^^
config/routes.rb:64:7: C: Align the elements of a hash literal if they span more than one line.
:as => 'current_credit_card'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
config/routes.rb:79:7: C: Align the elements of a hash literal if they span more than one line.
:as => 'confirm_email'
^^^^^^^^^^^^^^^^^^^^^^
config/routes.rb:81:7: C: Align the elements of a hash literal if they span more than one line.
:as => 'dismiss_email_warning'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
config/routes.rb:83:7: C: Align the elements of a hash literal if they span more than one line.
:as => 'change_email'
^^^^^^^^^^^^^^^^^^^^^
config/routes.rb:85:7: C: Align the elements of a hash literal if they span more than one line.
:as => 'update_email'
^^^^^^^^^^^^^^^^^^^^^
config/schedule.rb:5:80: C: Line is too long. [92/79]
job_type :rake, "cd :path && RAILS_ENV=:environment bundle exec rake :task --silent :output"
^^^^^^^^^^^^^
config/unicorn.rb:48:42: C: Use && instead of and.
GC.respond_to?(:copy_on_write_friendly=) and
^^^
config/unicorn.rb:62:32: C: Use && instead of and.
defined?(ActiveRecord::Base) and
^^^
config/unicorn.rb:96:32: C: Use && instead of and.
defined?(ActiveRecord::Base) and
^^^
db/migrate/20110820183757_create_users.rb:1:1: C: Missing top-level class documentation comment.
class CreateUsers < ActiveRecord::Migration
^^^^^
db/migrate/20110821020718_create_articles.rb:1:1: C: Missing top-level class documentation comment.
class CreateArticles < ActiveRecord::Migration
^^^^^
db/migrate/20110829215505_create_authorizations.rb:1:1: C: Missing top-level class documentation comment.
class CreateAuthorizations < ActiveRecord::Migration
^^^^^
db/migrate/20110829215511_create_authorization_links.rb:1:1: C: Missing top-level class documentation comment.
class CreateAuthorizationLinks < ActiveRecord::Migration
^^^^^
db/migrate/20110829230541_add_github_nickname_to_user.rb:1:1: C: Missing top-level class documentation comment.
class AddGithubNicknameToUser < ActiveRecord::Migration
^^^^^
db/migrate/20110830041617_add_admin_field_to_user.rb:1:1: C: Missing top-level class documentation comment.
class AddAdminFieldToUser < ActiveRecord::Migration
^^^^^
db/migrate/20110830162757_create_shared_articles.rb:1:1: C: Missing top-level class documentation comment.
class CreateSharedArticles < ActiveRecord::Migration
^^^^^
db/migrate/20110901130928_create_comments.rb:1:1: C: Missing top-level class documentation comment.
class CreateComments < ActiveRecord::Migration
^^^^^
db/migrate/20110909193908_create_announcements.rb:1:1: C: Missing top-level class documentation comment.
class CreateAnnouncements < ActiveRecord::Migration
^^^^^
db/migrate/20110912173127_add_email_preferences_to_users.rb:1:1: C: Missing top-level class documentation comment.
class AddEmailPreferencesToUsers < ActiveRecord::Migration
^^^^^
db/migrate/20110912173127_add_email_preferences_to_users.rb:3:80: C: Line is too long. [88/79]
add_column :users, :notify_conversations, :boolean, :default => true, :null => false
^^^^^^^^^
db/migrate/20110912173127_add_email_preferences_to_users.rb:4:80: C: Line is too long. [88/79]
add_column :users, :notify_mentions, :boolean, :default => true, :null => false
^^^^^^^^^
db/migrate/20110912175336_add_issue_number_to_articles.rb:1:1: C: Missing top-level class documentation comment.
class AddIssueNumberToArticles < ActiveRecord::Migration
^^^^^
db/migrate/20110916131749_create_emails.rb:4:3: C: Method has too many lines. [11/10]
def self.up
^^^
db/migrate/20110916132222_create_delayed_jobs.rb:1:1: C: Missing top-level class documentation comment.
class CreateDelayedJobs < ActiveRecord::Migration
^^^^^
db/migrate/20110916132222_create_delayed_jobs.rb:2:3: C: Method has too many lines. [12/10]
def self.up
^^^
db/migrate/20110916132222_create_delayed_jobs.rb:4:80: C: Line is too long. [103/79]
table.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue
^^^^^^^^^^^^^^^^^^^^^^^^
db/migrate/20110916132222_create_delayed_jobs.rb:5:80: C: Line is too long. [101/79]
table.integer :attempts, :default => 0 # Provides for retries, but still fail eventually.
^^^^^^^^^^^^^^^^^^^^^^
db/migrate/20110916132222_create_delayed_jobs.rb:6:80: C: Line is too long. [104/79]
table.text :handler # YAML-encoded string of the object that will do work
^^^^^^^^^^^^^^^^^^^^^^^^^
db/migrate/20110916132222_create_delayed_jobs.rb:7:80: C: Line is too long. [93/79]
table.text :last_error # reason for last failure (See Note below)
^^^^^^^^^^^^^^
db/migrate/20110916132222_create_delayed_jobs.rb:8:80: C: Line is too long. [132/79]
table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
db/migrate/20110916132222_create_delayed_jobs.rb:9:80: C: Line is too long. [96/79]
table.datetime :locked_at # Set when a client is working on this object
^^^^^^^^^^^^^^^^^
db/migrate/20110916132222_create_delayed_jobs.rb:10:80: C: Line is too long. [139/79]
table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
db/migrate/20110916132222_create_delayed_jobs.rb:11:80: C: Line is too long. [94/79]
table.string :locked_by # Who is working on this object (if locked)
^^^^^^^^^^^^^^^
db/migrate/20110916132222_create_delayed_jobs.rb:14:1: C: Tab detected.
db/migrate/20110916132222_create_delayed_jobs.rb:14:1: C: Trailing whitespace detected.
db/migrate/20110916132222_create_delayed_jobs.rb:15:80: C: Line is too long. [83/79]
add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority'
^^^^
db/migrate/20110916132222_create_delayed_jobs.rb:17:1: C: Trailing whitespace detected.
db/migrate/20110916132222_create_delayed_jobs.rb:19:29: C: Trailing whitespace detected.
drop_table :delayed_jobs
^^
db/migrate/20110916132222_create_delayed_jobs.rb:21:3: C: Source files should end with a newline (\n).
end
^
db/migrate/20110916140124_change_mail_columns_to_text.rb:1:1: C: Missing top-level class documentation comment.
class ChangeMailColumnsToText < ActiveRecord::Migration
^^^^^
db/migrate/20110916140124_change_mail_columns_to_text.rb:2:14: C: Space inside square brackets detected.
COLUMNS = [ :to_address, :cc_address, :bcc_address, :reply_to_address,
^
db/migrate/20110916140124_change_mail_columns_to_text.rb:3:23: C: Space inside square brackets detected.
:subject ]
^
db/migrate/20111108180149_add_notify_comment_made_to_users.rb:1:1: C: Missing top-level class documentation comment.
class AddNotifyCommentMadeToUsers < ActiveRecord::Migration
^^^^^
db/migrate/20111108180149_add_notify_comment_made_to_users.rb:3:80: C: Line is too long. [88/79]
add_column :users, :notify_comment_made, :boolean, :default => false, :null => false
^^^^^^^^^
db/migrate/20111206143647_add_broadcast_columns_to_announcements.rb:1:1: C: Missing top-level class documentation comment.
class AddBroadcastColumnsToAnnouncements < ActiveRecord::Migration
^^^^^
db/migrate/20111206143647_add_broadcast_columns_to_announcements.rb:3:80: C: Line is too long. [86/79]
add_column :announcements, :broadcast, :boolean, :default => false, :null => false
^^^^^^^
db/migrate/20120112195907_create_article_visits.rb:1:1: C: Missing top-level class documentation comment.
class CreateArticleVisits < ActiveRecord::Migration
^^^^^
db/migrate/20120319214410_add_beta_tester_field_to_users.rb:1:1: C: Missing top-level class documentation comment.
class AddBetaTesterFieldToUsers < ActiveRecord::Migration
^^^^^
db/migrate/20120328150809_create_volumes.rb:1:1: C: Missing top-level class documentation comment.
class CreateVolumes < ActiveRecord::Migration
^^^^^
db/migrate/20120328151105_add_volume_id_to_articles.rb:1:1: C: Missing top-level class documentation comment.
class AddVolumeIdToArticles < ActiveRecord::Migration
^^^^^
db/migrate/20120406161709_add_account_disabled_field_to_user.rb:1:1: C: Missing top-level class documentation comment.
class AddAccountDisabledFieldToUser < ActiveRecord::Migration
^^^^^
db/migrate/20120407204814_create_collections.rb:1:1: C: Missing top-level class documentation comment.
class CreateCollections < ActiveRecord::Migration
^^^^^
db/migrate/20120407205455_add_collection_id_to_articles.rb:1:1: C: Missing top-level class documentation comment.
class AddCollectionIdToArticles < ActiveRecord::Migration
^^^^^
db/migrate/20120516152433_add_notifications_enabled_to_users.rb:1:1: C: Missing top-level class documentation comment.
class AddNotificationsEnabledToUsers < ActiveRecord::Migration
^^^^^
db/migrate/20120516152433_add_notifications_enabled_to_users.rb:3:80: C: Line is too long. [90/79]
add_column :users, :notifications_enabled, :boolean, :null => false, :default => false
^^^^^^^^^^^
db/migrate/20120626145819_add_queue_to_delayed_jobs.rb:1:1: C: Missing top-level class documentation comment.
class AddQueueToDelayedJobs < ActiveRecord::Migration
^^^^^
db/migrate/20120801233245_add_position_to_collections.rb:1:1: C: Missing top-level class documentation comment.
class AddPositionToCollections < ActiveRecord::Migration
^^^^^
db/migrate/20120803001039_add_url_to_announcements.rb:1:1: C: Missing top-level class documentation comment.
class AddUrlToAnnouncements < ActiveRecord::Migration
^^^^^
db/migrate/20120831190102_add_status_to_users.rb:1:1: C: Missing top-level class documentation comment.
class AddStatusToUsers < ActiveRecord::Migration
^^^^^
db/migrate/20120831192230_add_access_token_to_user.rb:1:1: C: Missing top-level class documentation comment.
class AddAccessTokenToUser < ActiveRecord::Migration
^^^^^
db/migrate/20120914175304_add_notify_updates_to_users.rb:1:1: C: Missing top-level class documentation comment.
class AddNotifyUpdatesToUsers < ActiveRecord::Migration
^^^^^
db/migrate/20120914175304_add_notify_updates_to_users.rb:3:80: C: Line is too long. [82/79]
add_column :users, :notify_updates, :boolean, :default => true, :null => false
^^^
db/migrate/20120927154744_add_payment_models.rb:1:1: C: Missing top-level class documentation comment.
class AddPaymentModels < ActiveRecord::Migration
^^^^^
db/migrate/20120927154744_add_payment_models.rb:2:3: C: Method has too many lines. [18/10]
def up
^^^
db/migrate/20120927154744_add_payment_models.rb:27:5: C: Missing space after #.
#remove_column :users, :mailchimp_web_id
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
db/migrate/20120927154744_add_payment_models.rb:34:5: C: Missing space after #.
#add_column :users, :mailchimp_web_id, :text
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
db/migrate/20121011002134_add_coupon_code_to_subscriptions.rb:1:1: C: Missing top-level class documentation comment.
class AddCouponCodeToSubscriptions < ActiveRecord::Migration
^^^^^
db/migrate/20121019183135_create_credit_cards.rb:1:1: C: Missing top-level class documentation comment.
class CreateCreditCards < ActiveRecord::Migration
^^^^^
db/migrate/20130215174537_create_payments.rb:1:1: C: Missing top-level class documentation comment.
class CreatePayments < ActiveRecord::Migration
^^^^^
db/migrate/20130809174926_add_summary_to_articles.rb:1:1: C: Missing top-level class documentation comment.
class AddSummaryToArticles < ActiveRecord::Migration
^^^^^
db/migrate/20130816174433_add_slug_to_articles.rb:1:1: C: Missing top-level class documentation comment.
class AddSlugToArticles < ActiveRecord::Migration
^^^^^
db/migrate/20130820143254_add_share_token_to_user.rb:1:1: C: Missing top-level class documentation comment.
class AddShareTokenToUser < ActiveRecord::Migration
^^^^^
db/migrate/20130920195554_add_recommended_to_articles.rb:1:1: C: Missing top-level class documentation comment.
class AddRecommendedToArticles < ActiveRecord::Migration
^^^^^
db/migrate/20130920195554_add_recommended_to_articles.rb:3:80: C: Line is too long. [83/79]
add_column :articles, :recommended, :boolean, :default => false, :null => false
^^^^
db/migrate/20131114225709_add_interval_to_subscriptions.rb:1:1: C: Missing top-level class documentation comment.
class AddIntervalToSubscriptions < ActiveRecord::Migration
^^^^^
db/migrate/20131204201817_add_email_confirmed_to_users.rb:1:1: C: Missing top-level class documentation comment.
class AddEmailConfirmedToUsers < ActiveRecord::Migration
^^^^^
db/schema.rb:4:80: C: Line is too long. [81/79]
# incrementally modify your database, and then regenerate this schema definition.
^^
db/schema.rb:9:80: C: Line is too long. [86/79]
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
^^^^^^^
db/schema.rb:12:80: C: Line is too long. [80/79]
# It's strongly recommended to check this file into your version control system.
^
db/schema.rb:14:41: C: Separate every 3 digits in the integer portion of a number with underscores(_).
ActiveRecord::Schema.define(:version => 20131204201817) do
^^^^^^^^^^^^^^
db/schema.rb:109:29: C: Use %w or %W for array of words.
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
^^^^^^^^^^^^^^^^^^^^^^
db/schema.rb:109:80: C: Line is too long. [84/79]
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
^^^^^
db/seeds.rb:1:80: C: Line is too long. [103/79]
# This file should contain all the record creation needed to seed the database with its default values.
^^^^^^^^^^^^^^^^^^^^^^^^
db/seeds.rb:2:80: C: Line is too long. [96/79]
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
^^^^^^^^^^^^^^^^^
db/seeds.rb:10:52: C: Trailing whitespace detected.
u = User.new(:github_nickname => github_nickname,
^
db/seeds.rb:20:80: C: Line is too long. [80/79]
# ------------------------------------------------------------------------------
^
db/seeds.rb:22:80: C: Line is too long. [80/79]
# ------------------------------------------------------------------------------
^
db/seeds.rb:26:80: C: Line is too long. [80/79]
# ------------------------------------------------------------------------------
^
db/seeds.rb:28:80: C: Line is too long. [80/79]
# ------------------------------------------------------------------------------
^
db/seeds.rb:34:80: C: Line is too long. [80/79]
# ------------------------------------------------------------------------------
^
db/seeds.rb:36:80: C: Line is too long. [80/79]
# ------------------------------------------------------------------------------
^
lib/cache_cooker.rb:3:80: C: Line is too long. [81/79]
# CacheCooker hooks into your Rails app and helps you keep your caches up-to-date
^^
lib/cache_cooker.rb:31:38: C: Space inside { missing.
CacheCooker.get(url, :headers => {'cache-cooker' => 'enabled'})
^
lib/cache_cooker.rb:31:66: C: Space inside } missing.
CacheCooker.get(url, :headers => {'cache-cooker' => 'enabled'})
^
lib/mail_chimp/web_hooks.rb:2:3: C: Missing top-level class documentation comment.
class WebHooks
^^^^^
lib/mail_chimp/web_hooks.rb:3:1: C: Extra blank line detected at body beginning.
lib/mail_chimp/web_hooks.rb:11:5: C: Method has too many lines. [11/10]
def process
^^^
lib/mail_chimp/web_hooks.rb:31:15: W: Assignment in condition - you probably meant to use ==.
if user = find_user
^
lib/mail_chimp/web_hooks.rb:56:80: C: Line is too long. [80/79]
(payment_provider = ? AND payment_provider_id = ?) OR LOWER(email) = ?},
^
lib/mail_chimp/web_hooks.rb:57:9: C: Align the parameters of a method call if they span more than one line.
'mailchimp', params[:data][:web_id], params[:data][:email].downcase
^^^^^^^^^^^
lib/md_mentions.rb:2:3: C: Missing top-level class documentation comment.
class Render < MdEmoji::Render
^^^^^
lib/md_mentions.rb:5:18: C: Avoid the use of Perl-style backrefs.
github = $1
^^
lib/md_mentions.rb:6:80: C: Line is too long. [82/79]
user = User.where("LOWER(github_nickname) = ?", github.downcase).exists?
^^^
lib/md_mentions.rb:8:20: C: Avoid the use of Perl-style backrefs.
if user && $2.blank?
^^
lib/md_mentions.rb:18:3: C: Source files should end with a newline (\n).
end
^
lib/rake_exception_notification.rb:1:1: C: Missing top-level module documentation comment.
module RakeExceptionNotification
^^^^^^
lib/rake_exception_notification.rb:8:80: C: Line is too long. [90/79]
# Wrap your code inside an exception_notify block and you will be notified of exceptions
^^^^^^^^^^^
lib/rake_exception_notification.rb:11:3: C: Method has too many lines. [12/10]
def exception_notify
^^^
lib/rake_exception_notification.rb:13:3: W: Avoid rescuing the Exception class.
rescue Exception => exception
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rake_exception_notification.rb:19:80: C: Line is too long. [86/79]
:exception_recipients => %w{[email protected] [email protected]},
^^^^^^^
lib/rake_exception_notification.rb:22:80: C: Line is too long. [80/79]
ExceptionNotifier::Notifier.exception_notification(env, exception).deliver
^
lib/rake_exception_notification.rb:26:3: C: Source files should end with a newline (\n).
end
^
script/delayed_job:3:80: C: Line is too long. [90/79]
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
^^^^^^^^^^^
script/rails:2:80: C: Line is too long. [124/79]
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/factories/authorization_factory.rb:3:18: C: Separate every 3 digits in the integer portion of a number with underscores(_).
a.github_uid(12345)
^^^^^
test/factories/comment_factory.rb:9:3: C: Source files should end with a newline (\n).
end
^
test/factories/stripe.rb:4:11: W: (...) interpreted as grouped expression.
sequence (:stripe_customer_id) { |n| "cus_mock#{n}" }
^
test/factories/stripe.rb:5:11: W: (...) interpreted as grouped expression.
sequence (:stripe_invoice_id) { |n| "in_mock#{n}" }
^
test/factories/stripe.rb:16:3: C: Source files should end with a newline (\n).
end
^
test/factories/user_factory.rb:16:21: C: Avoid using {...} for multi-line blocks.
before(:create) {
^
test/factories/user_factory.rb:17:68: W: end at 17, 67 is not aligned with before(:create) { at 16, 4
User.skip_callback(:save, :before, :send_confirmation_email) }
^
test/factories/user_factory.rb:18:20: C: Avoid using {...} for multi-line blocks.
after(:create) {
^
test/factories/user_factory.rb:19:67: W: end at 19, 66 is not aligned with after(:create) { at 18, 4
User.set_callback(:save, :before, :send_confirmation_email) }
^
test/integration/account_cancelation_test.rb:3:1: C: Missing top-level class documentation comment.
class AccountCancelationTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/archives_test.rb:3:1: C: Missing top-level class documentation comment.
class ArchivesTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/archives_test.rb:88:80: C: Line is too long. [80/79]
# as well as it should here, but I'm not sure how to handle it for the moment.
^
test/integration/archives_test.rb:90:7: C: Do not prefix writer method names with set_.
def set_user_state(state)
^^^^^^^^^^^^^^
test/integration/archives_test.rb:91:80: C: Line is too long. [80/79]
raise ArgumentError unless [:logged_out, :logged_in, :guest].include?(state)
^
test/integration/article_routing_test.rb:3:1: C: Missing top-level class documentation comment.
class ArticleRoutingTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/authorization_failure_test.rb:3:1: C: Missing top-level class documentation comment.
class AuthorizationFailureTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/authorization_failure_test.rb:5:28: C: Trailing whitespace detected.
visit auth_failure_path
^
test/integration/broadcast_messages_test.rb:3:1: C: Missing top-level class documentation comment.
class BroadcastMessagesTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/broadcast_messages_test.rb:5:55: C: Trailing whitespace detected.
@admin = FactoryGirl.create(:user, :admin => true,
^
test/integration/broadcast_messages_test.rb:11:54: C: Trailing whitespace detected.
users = 3.times.map { FactoryGirl.create(:user) }
^
test/integration/broadcast_messages_test.rb:16:1: C: Extra blank line detected.
test/integration/broadcast_messages_test.rb:22:1: C: Trailing whitespace detected.
test/integration/broadcast_messages_test.rb:32:80: C: Line is too long. [80/79]
nothing_user = FactoryGirl.create(:user, :notifications_enabled => false)
^
test/integration/broadcast_messages_test.rb:34:5: W: Useless assignment to variable - updated_users
updated_users = 5.times.map { FactoryGirl.create(:user) }
^^^^^^^^^^^^^
test/integration/broadcast_messages_test.rb:44:13: C: Align the parameters of a method call if they span more than one line.
"User was sent a broadcast message and their notifications are disabled"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/integration/broadcast_messages_test.rb:44:80: C: Line is too long. [84/79]
"User was sent a broadcast message and their notifications are disabled"
^^^^^
test/integration/broadcast_messages_test.rb:58:3: C: Method has too many lines. [16/10]
def send_message(options = {})
^^^
test/integration/broadcast_messages_test.rb:68:16: C: Trailing whitespace detected.
when "Test"
^
test/integration/broadcast_test.rb:3:1: C: Missing top-level class documentation comment.
class BroadcastTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/broadcast_test.rb:4:1: C: Extra blank line detected at body beginning.
test/integration/broadcast_test.rb:50:1: C: Extra blank line detected at body end.
test/integration/change_billing_interval_test.rb:3:1: C: Missing top-level class documentation comment.
class ChangeBillingIntervalTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/change_billing_interval_test.rb:9:19: C: Place the . on the next line, together with the method name.
simulated_user.
^
test/integration/change_billing_interval_test.rb:10:47: C: Place the . on the next line, together with the method name.
register(Support::SimulatedUser.default).
^
test/integration/change_billing_interval_test.rb:17:19: C: Place the . on the next line, together with the method name.
simulated_user.
^
test/integration/change_billing_interval_test.rb:18:80: C: Line is too long. [82/79]
register(Support::SimulatedUser.default.merge(:billing_interval => 'year')).
^^^
test/integration/change_billing_interval_test.rb:18:82: C: Place the . on the next line, together with the method name.
register(Support::SimulatedUser.default.merge(:billing_interval => 'year')).
^
test/integration/confirm_user_email_test.rb:3:1: C: Missing top-level class documentation comment.
class ConfirmUserEmailTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/conversation_test.rb:3:1: C: Extra blank line detected.
test/integration/conversation_test.rb:4:1: C: Missing top-level class documentation comment.
class ConversationTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/conversation_test.rb:6:40: C: Avoid using {...} for multi-line blocks.
contacted_users = 10.times.map { FactoryGirl.create(:user,
^
test/integration/conversation_test.rb:7:80: C: Line is too long. [91/79]
:notifications_enabled => true,
^^^^^^^^^^^^
test/integration/conversation_test.rb:8:80: C: Line is too long. [91/79]
:notify_conversations => true,
^^^^^^^^^^^^
test/integration/conversation_test.rb:9:80: C: Line is too long. [91/79]
:notify_comment_made => true,
^^^^^^^^^^^^
test/integration/conversation_test.rb:10:80: C: Line is too long. [92/79]
:notify_mentions => true) }
^^^^^^^^^^^^^
test/integration/conversation_test.rb:10:92: W: end at 10, 91 is not aligned with contacted_users = 10.times.map { FactoryGirl.create(:user, at 6, 4
:notify_mentions => true) }
^
test/integration/conversation_test.rb:12:5: W: Useless assignment to variable - not_contacted_users
not_contacted_users = 5.times.map { FactoryGirl.create(:user,
^^^^^^^^^^^^^^^^^^^
test/integration/conversation_test.rb:12:40: C: Avoid using {...} for multi-line blocks.
not_contacted_users = 5.times.map { FactoryGirl.create(:user,
^
test/integration/conversation_test.rb:12:67: C: Trailing whitespace detected.
not_contacted_users = 5.times.map { FactoryGirl.create(:user,
^
test/integration/conversation_test.rb:13:80: C: Line is too long. [94/79]
:notifications_enabled => false) }
^^^^^^^^^^^^^^^
test/integration/conversation_test.rb:13:94: W: end at 13, 93 is not aligned with not_contacted_users = 5.times.map { FactoryGirl.create(:user, at 12, 4
:notifications_enabled => false) }
^
test/integration/conversation_test.rb:25:30: C: Align the elements of a hash literal if they span more than one line.
:bcc => @expected_contacted_emails)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/integration/conversation_test.rb:39:1: C: Trailing whitespace detected.
test/integration/credit_card_expiration_test.rb:4:1: C: Missing top-level class documentation comment.
class CreditCardExpirationTest < ActionMailer::TestCase
^^^^^
test/integration/credit_card_expiration_test.rb:5:1: C: Extra blank line detected at body beginning.
test/integration/credit_card_expiration_test.rb:23:75: C: Space inside parentheses detected.
:expiration_month => this_month.month )
^
test/integration/credit_card_expiration_test.rb:27:77: C: Space inside parentheses detected.
:expiration_month => future_month.month )
^
test/integration/credit_card_expiration_test.rb:33:3: C: Source files should end with a newline (\n).
end
^
test/integration/disabled_accounts_test.rb:3:1: C: Missing top-level class documentation comment.
class DisabledAccountsTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/edit_article_test.rb:3:1: C: Missing top-level class documentation comment.
class EditArticleTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/profile_test.rb:3:1: C: Missing top-level class documentation comment.
class ProfileTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/registration_test.rb:3:1: C: Missing top-level class documentation comment.
class RegistrationTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/registration_test.rb:34:1: C: Extra blank line detected.
test/integration/registration_test.rb:52:19: C: Space inside { missing.
user_params = {:nickname => "TestUser", :uid => "12345"}
^
test/integration/registration_test.rb:52:60: C: Space inside } missing.
user_params = {:nickname => "TestUser", :uid => "12345"}
^
test/integration/registration_test.rb:76:1: C: Extra blank line detected.
test/integration/shared_article_test.rb:3:1: C: Missing top-level class documentation comment.
class SharedArticleTest < ActionDispatch::IntegrationTest
^^^^^
test/integration/shared_article_test.rb:39:1: C: Trailing whitespace detected.
test/integration/shared_article_test.rb:46:1: C: Extra blank line detected.
test/integration/shared_article_test.rb:53:3: C: Method has too many lines. [12/10]
def assert_article_visible(state)
^^^
test/integration/shared_article_test.rb:58:80: C: Line is too long. [83/79]
assert_current_path Rails.application.routes.url_helpers.article_path(@article)
^^^^
test/support/integration.rb:2:3: C: Missing top-level module documentation comment.
module Integration
^^^^^^
test/support/integration.rb:3:32: C: Surrounding space missing in default value assignment.
def assert_css(css, options={})
^
test/support/integration.rb:5:9: C: Align the parameters of a method call if they span more than one line.
"CSS #{css.inspect} with options #{options.inspect} does not exist"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/support/integration.rb:20:36: C: Surrounding space missing in default value assignment.
def assert_field(label, options={})
^
test/support/integration.rb:22:9: C: Align the parameters of a method call if they span more than one line.
"Field #{label.inspect} with options #{options.inspect} does not exist"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/support/integration.rb:25:39: C: Surrounding space missing in default value assignment.
def assert_no_field(label, options={})
^
test/support/integration.rb:27:9: C: Align the parameters of a method call if they span more than one line.
"Field #{label.inspect} with options #{options.inspect} exists"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/support/integration.rb:32:9: C: Align the parameters of a method call if they span more than one line.
"Flash #{message.inspect} does not exist in the page"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/support/integration.rb:43:36: C: Surrounding space missing in default value assignment.
def assert_link_to(url, options={})
^
test/support/integration.rb:44:33: C: Favor sprintf over String#%.
assert_css "a[href='%s']" % url, options
^
test/support/integration.rb:80:29: C: Surrounding space missing in default value assignment.
def within(scope, prefix=nil)
^
test/support/integration.rb:81:80: C: Line is too long. [112/79]
scope = '#' << ActionController::RecordIdentifier.dom_id(scope, prefix) if scope.is_a?(ActiveRecord::Base)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/support/integration.rb:87:80: C: Line is too long. [83/79]
raise "Block interface has been removed. Make direct method calls instead"
^^^^
test/support/integration.rb:87:83: C: Trailing whitespace detected.
raise "Block interface has been removed. Make direct method calls instead"
^
test/support/mini_contest.rb:4:1: C: Extra blank line detected at body beginning.
test/support/mini_contest.rb:33:52: C: Avoid the use of Perl-style backrefs.
"Test#{sanitize_name(name).gsub(/(^| )(\w)/) { $2.upcase }}".to_sym
^^
test/support/mini_contest.rb:37:43: C: Space missing after comma.
"test_#{sanitize_name(name).gsub(/\s+/,'_')}".to_sym
^
test/support/mini_contest.rb:51:1: C: Missing top-level class documentation comment.
class MiniTest::Unit::TestCase
^^^^^
test/support/mini_contest.rb:53:3: C: Source files should end with a newline (\n).
end
^
test/support/outbox.rb:2:3: C: Missing top-level class documentation comment.
class Outbox
^^^^^
test/support/outbox.rb:10:5: C: Method has too many lines. [16/10]
def has_message_with(params)
^^^
test/support/outbox.rb:10:9: C: Rename has_message_with to message_with?.
def has_message_with(params)
^^^^^^^^^^^^^^^^
test/support/outbox.rb:15:70: C: Trailing whitespace detected.
subject_matches = e.subject.match(params.fetch(:subject, //))
^
test/support/outbox.rb:33:1: C: Extra blank line detected at body end.
test/support/simulated_user.rb:2:3: C: Class definition is too long. [186/100]
class SimulatedUser
^^^^^
test/support/simulated_user.rb:2:3: C: Missing top-level class documentation comment.
class SimulatedUser
^^^^^
test/support/simulated_user.rb:3:5: C: Missing top-level class documentation comment.
class Proxy
^^^^^
test/support/simulated_user.rb:31:41: C: Redundant curly braces around a hash parameter.
OmniAuth.config.add_mock(:github, {
^
test/support/simulated_user.rb:50:31: C: Surrounding space missing in default value assignment.
def confirm_email(attempts=1)
^
test/support/simulated_user.rb:53:50: C: Place the . on the next line, together with the method name.
base = Rails.application.routes.url_helpers.
^
test/support/simulated_user.rb:56:45: C: Space missing after comma.
secret = mail.body.to_s[/#{base}(\h+)/,1]
^
test/support/simulated_user.rb:64:28: C: Surrounding space missing in default value assignment.
def make_payment(params={})
^
test/support/simulated_user.rb:74:31: C: Surrounding space missing in default value assignment.
def make_db_payment(params={})
^
test/support/simulated_user.rb:90:5: C: Method has too many lines. [14/10]
def make_stripe_payment(params={})
^^^
test/support/simulated_user.rb:90:35: C: Surrounding space missing in default value assignment.
def make_stripe_payment(params={})
^
test/support/simulated_user.rb:141:5: C: Method has too many lines. [18/10]
def cancel_account
^^^
test/support/simulated_user.rb:173:5: C: Method has too many lines. [20/10]
def change_billing_interval
^^^
test/support/simulated_user.rb:183:18: W: ambiguous first argument; parenthesize arguments or add whitespace to the right
assert /Change to (yearly|monthly) billing/ =~ first(:link).text
^
test/support/simulated_user.rb:187:9: C: Annotation keywords should be all upper case, followed by a colon and a space, then a note describing the problem.
# FIXME Simulate billing switch
^^^^^
test/support/simulated_user.rb:202:35: C: Surrounding space missing in default value assignment.
def update_email_address(email=nil)
^
test/support/simulated_user.rb:224:28: C: Surrounding space missing in default value assignment.
def edit_profile(params={})
^
test/support/simulated_user.rb:237:5: C: Method has too many lines. [15/10]
def click_subscribe
^^^
test/support/simulated_user.rb:240:80: C: Line is too long. [80/79]
# FIXME: This is a bit of a hack, and duplicates the authenticate() method
^
test/support/simulated_user.rb:241:41: C: Redundant curly braces around a hash parameter.
OmniAuth.config.add_mock(:github, {
^
test/support/stripe/invoice.rb:3:5: C: Missing top-level class documentation comment.
class Invoice
^^^^^
test/support/stripe/invoice.rb:18:3: C: Source files should end with a newline (\n).
end
^
test/test_helper.rb:25:1: C: Missing space after #.
#Delayed::Worker.delay_jobs = false
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/card_expirer_test.rb:3:1: C: Missing top-level class documentation comment.
class CardExpirerTest < ActiveSupport::TestCase
^^^^^
test/unit/card_expirer_test.rb:5:5: C: Missing space after #.
#FIXME: Less duplication, push into factories w. better names?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/card_expirer_test.rb:6:1: C: Trailing whitespace detected.
test/unit/card_expirer_test.rb:9:1: C: Extra blank line detected.
test/unit/card_expirer_test.rb:12:80: C: Line is too long. [81/79]
@users[:inactive_expiring] = FactoryGirl.create(:user, :status => "disabled")
^^
test/unit/card_expirer_test.rb:13:80: C: Line is too long. [80/79]
@users[:non_expiring] = FactoryGirl.create(:user, :status => "active")
^
test/unit/card_expirer_test.rb:13:80: C: Trailing whitespace detected.
@users[:non_expiring] = FactoryGirl.create(:user, :status => "active")
^
test/unit/card_expirer_test.rb:15:1: C: Extra blank line detected.
test/unit/card_expirer_test.rb:17:1: C: Trailing whitespace detected.
test/unit/card_expirer_test.rb:19:36: C: Align the parameters of a method call if they span more than one line.
:expiration_month => Date.today.month,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/card_expirer_test.rb:21:80: C: Line is too long. [81/79]
:user => @users[:active_expiring])
^^
test/unit/card_expirer_test.rb:24:36: C: Align the parameters of a method call if they span more than one line.
:expiration_month => Date.today.month,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/card_expirer_test.rb:26:80: C: Line is too long. [83/79]
:user => @users[:inactive_expiring])
^^^^
test/unit/card_expirer_test.rb:29:36: C: Align the parameters of a method call if they span more than one line.
:expiration_month => Date.today.month,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/card_expirer_test.rb:31:80: C: Line is too long. [81/79]
:user => @users[:active_expiring])
^^
test/unit/card_expirer_test.rb:35:79: C: Trailing whitespace detected.
assert(@users.values.map { |e| e.contact_email }.uniq.size == @users.size,
^
test/unit/card_expirer_test.rb:36:11: C: Align the parameters of a method call if they span more than one line.
"Programmer error, check your factories")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/card_expirer_test.rb:42:80: C: Line is too long. [93/79]
assert ActionMailer::Base.deliveries.count == 1, "Should only send one expiration notice"
^^^^^^^^^^^^^^
test/unit/card_expirer_test.rb:44:59: C: Trailing whitespace detected.
assert_equal [@users[:active_expiring].contact_email],
^
test/unit/comment_test.rb:3:1: C: Missing top-level class documentation comment.
class CommentTest < ActiveSupport::TestCase
^^^^^
test/unit/comment_test.rb:13:9: C: Align the parameters of a method call if they span more than one line.
:body => "I mention @person but they don't exist")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/comment_test.rb:23:9: C: Align the parameters of a method call if they span more than one line.
:body => "I mention @PerSon and @frank-pepelio")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/comment_test.rb:36:9: C: Align the parameters of a method call if they span more than one line.
:body => "I mention @frank-pepelio and @noexist")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/comment_test.rb:47:9: C: Align the parameters of a method call if they span more than one line.
:body => "I mention @FRANK-pepelio")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/comment_test.rb:58:80: C: Line is too long. [86/79]
comment = FactoryGirl.create(:comment, :body => "@person, @frank-pepelio: YAY!")
^^^^^^^
test/unit/decorators/comment_decorator_test.rb:3:1: C: Missing top-level class documentation comment.
class CommentDecoratorTest < ActiveSupport::TestCase
^^^^^
test/unit/decorators/comment_decorator_test.rb:6:80: C: Line is too long. [80/79]
comment = FactoryGirl.create(:comment, :body => "@frank-pepelio: Hey dude!")
^
test/unit/decorators/comment_decorator_test.rb:9:28: C: Use %r for regular expressions matching more than 1 '/' character.
assert comment.content[/<a href="\/users\/#{frank.github_nickname}"/],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/decorators/comment_decorator_test.rb:17:28: C: Use %r for regular expressions matching more than 1 '/' character.
refute comment.content[/<a href="\/users\/unknown"/],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/decorators/comment_decorator_test.rb:26:7: C: Align the parameters of a method call if they span more than one line.
:body => "Dude email me [email protected]")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/decorators/comment_decorator_test.rb:29:28: C: Use %r for regular expressions matching more than 1 '/' character.
refute comment.content[/<a href="\/users\//],
^^^^^^^^^^^^^^^^^^^^
test/unit/mail_chimp/web_hooks_test.rb:4:1: C: Missing top-level class documentation comment.
class MailChimpWebHooksTest < ActiveSupport::TestCase
^^^^^
test/unit/mail_chimp/web_hooks_test.rb:5:1: C: Extra blank line detected at body beginning.
test/unit/mailers/account_mailer_test.rb:3:1: C: Missing top-level class documentation comment.
class AccountMailerTest < ActionMailer::TestCase
^^^^^
test/unit/mailers/account_mailer_test.rb:25:3: C: Source files should end with a newline (\n).
end
^
test/unit/mailers/broadcast_mailer_test.rb:3:1: C: Missing top-level class documentation comment.
class BroadcastMailerTest < ActionMailer::TestCase
^^^^^
test/unit/mailers/broadcast_mailer_test.rb:20:13: C: Align the parameters of a method call if they span more than one line.
"User with status '#{user.status}' was sent a broadcast"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/broadcast_mailer_test.rb:25:5: W: Useless assignment to variable - user
user = FactoryGirl.create(:user)
^^^^
test/unit/mailers/broadcast_mailer_test.rb:28:5: W: Useless assignment to variable - article
article = FactoryGirl.create(:article, :slug => slug)
^^^^^^^
test/unit/mailers/broadcast_mailer_test.rb:32:80: C: Line is too long. [82/79]
Broadcaster.notify_subscribers(:body => message_body, :subject => "Hi there!")
^^^
test/unit/mailers/broadcast_mailer_test.rb:40:80: C: Line is too long. [110/79]
assert message.body.to_s[expected_body], "Expected link to be expanded, instead got: #{message.body.to_s}"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:3:1: C: Missing top-level class documentation comment.
class ConversationMailerTest < ActionMailer::TestCase
^^^^^
test/unit/mailers/conversation_mailer_test.rb:9:7: W: Useless assignment to variable - comment
comment = FactoryGirl.create(:comment, :body => "No mentions here")
^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:10:7: W: Useless assignment to variable - no_email
no_email = FactoryGirl.create(:user, :notify_conversations => false)
^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:16:80: C: Line is too long. [85/79]
admin = FactoryGirl.create(:user, :admin => true, :github_nickname => "Jordan")
^^^^^^
test/unit/mailers/conversation_mailer_test.rb:19:7: W: Useless assignment to variable - mention_comment
mention_comment = FactoryGirl.create(:comment, :body => "@#{admin.github_nickname}",
^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:19:80: C: Line is too long. [90/79]
mention_comment = FactoryGirl.create(:comment, :body => "@#{admin.github_nickname}",
^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:20:9: C: Align the elements of a hash literal if they span more than one line.
:commentable => first_comment.commentable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:22:56: C: Space between { and | missing.
email_bodies = ActionMailer::Base.deliveries.map {|e| e.body.to_s }
^^
test/unit/mailers/conversation_mailer_test.rb:33:80: C: Line is too long. [83/79]
first_comment = FactoryGirl.create(:comment, :body => "First Comment",
^^^^
test/unit/mailers/conversation_mailer_test.rb:34:41: C: Align the elements of a hash literal if they span more than one line.
:commentable => article)
^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:38:7: W: Useless assignment to variable - mention_comment
mention_comment = FactoryGirl.create(:comment,
^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:39:9: C: Align the parameters of a method call if they span more than one line.
:body => "Hi @#{first_comment.user.github_nickname}",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:52:80: C: Line is too long. [81/79]
notify_user = FactoryGirl.create(:user, :notify_comment_made => true )
^^
test/unit/mailers/conversation_mailer_test.rb:52:80: C: Space inside parentheses detected.
notify_user = FactoryGirl.create(:user, :notify_comment_made => true )
^
test/unit/mailers/conversation_mailer_test.rb:53:80: C: Line is too long. [81/79]
dont_notify_user = FactoryGirl.create(:user, :notify_comment_made => false)
^^
test/unit/mailers/conversation_mailer_test.rb:56:41: C: Align the elements of a hash literal if they span more than one line.
:user => notify_user)
^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:62:7: W: Useless assignment to variable - second_comment
second_comment = FactoryGirl.create(:comment, :body => "Second Comment",
^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:62:80: C: Line is too long. [85/79]
second_comment = FactoryGirl.create(:comment, :body => "Second Comment",
^^^^^^
test/unit/mailers/conversation_mailer_test.rb:63:42: C: Align the elements of a hash literal if they span more than one line.
:user => dont_notify_user,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:64:42: C: Align the elements of a hash literal if they span more than one line.
:commentable => first_comment.commentable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:64:80: C: Line is too long. [83/79]
:commentable => first_comment.commentable)
^^^^
test/unit/mailers/conversation_mailer_test.rb:69:74: W: end at 69, 73 is not aligned with messages.count { |msg| at 68, 22 or assert_equal 0, messages.count { |msg| at 68, 6
msg.bcc.include?(dont_notify_user.contact_email) }
^
test/unit/mailers/conversation_mailer_test.rb:72:69: W: end at 72, 68 is not aligned with messages.count { |msg| at 71, 22 or assert_equal 1, messages.count { |msg| at 71, 6
msg.bcc.include?(notify_user.contact_email) }
^
test/unit/mailers/conversation_mailer_test.rb:79:80: C: Line is too long. [83/79]
user = FactoryGirl.create(:user, :notify_conversations => false )
^^^^
test/unit/mailers/conversation_mailer_test.rb:79:82: C: Space inside parentheses detected.
user = FactoryGirl.create(:user, :notify_conversations => false )
^
test/unit/mailers/conversation_mailer_test.rb:80:80: C: Line is too long. [82/79]
dont_notify_user = FactoryGirl.create(:user, :notify_conversations => false)
^^^
test/unit/mailers/conversation_mailer_test.rb:81:80: C: Line is too long. [82/79]
mentioned_user = FactoryGirl.create(:user, :notify_conversations => false,
^^^
test/unit/mailers/conversation_mailer_test.rb:82:41: C: Align the elements of a hash literal if they span more than one line.
:notify_comment_made => true,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:83:41: C: Align the elements of a hash literal if they span more than one line.
:github_nickname => "x" )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:83:69: C: Space inside parentheses detected.
:github_nickname => "x" )
^
test/unit/mailers/conversation_mailer_test.rb:86:9: C: Align the parameters of a method call if they span more than one line.
:body => "Hey @#{mentioned_user.github_nickname}",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:107:7: W: Useless assignment to variable - first_comment
first_comment = FactoryGirl.create(:comment, :body => "First Comment",
^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:108:41: C: Align the elements of a hash literal if they span more than one line.
:user => user)
^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:118:80: C: Line is too long. [83/79]
user = FactoryGirl.create(:user, :notify_conversations => false)
^^^^
test/unit/mailers/conversation_mailer_test.rb:119:80: C: Line is too long. [82/79]
dont_notify_user = FactoryGirl.create(:user, :notify_mentions => true,
^^^
test/unit/mailers/conversation_mailer_test.rb:120:41: C: Align the elements of a hash literal if they span more than one line.
:notifications_enabled => false,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:121:41: C: Align the elements of a hash literal if they span more than one line.
:notify_conversations => false,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:122:41: C: Align the elements of a hash literal if they span more than one line.
:github_nickname => "not_me")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:124:80: C: Line is too long. [87/79]
FactoryGirl.create(:comment, :body => "Hey @#{dont_notify_user.github_nickname}",
^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:125:25: C: Align the elements of a hash literal if they span more than one line.
:user => user )
^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:125:38: C: Space inside parentheses detected.
:user => user )
^
test/unit/mailers/conversation_mailer_test.rb:131:80: C: Line is too long. [83/79]
user = FactoryGirl.create(:user, :notify_conversations => false)
^^^^
test/unit/mailers/conversation_mailer_test.rb:132:7: W: Useless assignment to variable - dont_notify_user
dont_notify_user = FactoryGirl.create(:user, :notify_comment_made => true,
^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:132:80: C: Line is too long. [82/79]
dont_notify_user = FactoryGirl.create(:user, :notify_comment_made => true,
^^^
test/unit/mailers/conversation_mailer_test.rb:133:41: C: Align the elements of a hash literal if they span more than one line.
:notifications_enabled => false,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:134:41: C: Align the elements of a hash literal if they span more than one line.
:notify_conversations => false)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:136:80: C: Line is too long. [94/79]
first_comment = FactoryGirl.create(:comment, :body => "Oh yeah starting a conversation",
^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:137:41: C: Align the elements of a hash literal if they span more than one line.
:user => user )
^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:137:54: C: Space inside parentheses detected.
:user => user )
^
test/unit/mailers/conversation_mailer_test.rb:141:25: C: Align the elements of a hash literal if they span more than one line.
:user => user,
^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:142:25: C: Align the elements of a hash literal if they span more than one line.
:commentable => first_comment.commentable )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/mailers/conversation_mailer_test.rb:142:66: C: Space inside parentheses detected.
:commentable => first_comment.commentable )
^
test/unit/stripe/payment_gateway_test.rb:3:1: C: Missing top-level class documentation comment.
class StripePaymentGatewayTest < ActiveSupport::TestCase
^^^^^
test/unit/stripe/payment_gateway_test.rb:4:1: C: Extra blank line detected at body beginning.
test/unit/stripe/payment_gateway_test.rb:26:35: C: Space inside parentheses detected.
token = Stripe::Token.create( :card => { :number => "4242424242424242",
^
test/unit/stripe/payment_gateway_test.rb:34:11: C: Align the parameters of a method call if they span more than one line.
"Should have an active subscription after successful payment"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/stripe/payment_gateway_test.rb:49:35: C: Space inside parentheses detected.
token = Stripe::Token.create( :card => { :number => "4000000000000341",
^
test/unit/stripe/payment_gateway_test.rb:59:11: C: Align the parameters of a method call if they span more than one line.
"Should not have an active subscription after failed payment"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/unit/stripe/payment_gateway_test.rb:66:80: C: Line is too long. [84/79]
assert @user.subscriptions.active, "User does not have any active subscriptions"
^^^^^
test/unit/stripe/payment_gateway_test.rb:70:80: C: Line is too long. [82/79]
assert @user.disabled?, "User is still enabled after their subscription ended"
^^^
test/unit/user_manager_test.rb:4:1: C: Missing top-level class documentation comment.
class UserManagerTest < ActiveSupport::TestCase
^^^^^
test/unit/user_manager_test.rb:14:80: C: Line is too long. [85/79]
@user_manager.expects(:unsubscribed_users).returns([to_be_disabled_user.email])
^^^^^^
test/unit/user_manager_test.rb:26:80: C: Line is too long. [85/79]
@user_manager.expects(:unsubscribed_users).returns([to_be_disabled_user.email])
^^^^^^
test/unit/user_test.rb:3:1: C: Missing top-level class documentation comment.
class UserTest < ActiveSupport::TestCase
^^^^^
166 files inspected, 549 offences detected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment