thoughtbot/paperclip

View on GitHub

Showing 920 of 1,009 total issues

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Open

require 'paperclip/storage'
Severity: Minor
Found in lib/paperclip.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Open

require 'paperclip/io_adapters/abstract_adapter'
Severity: Minor
Found in lib/paperclip.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Space missing after comma.
Open

            s3_headers[name.to_s.downcase.sub(/\Ax-amz-/,'').tr("-","_").to_sym] = value
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

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

        http_headers.inject({}) do |headers,(name,value)|
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

This cop checks for unused block arguments.

Example:

# bad

do_something do |used, unused|
  puts used
end

do_something do |bar|
  puts :foo
end

define_method(:foo) do |bar|
  puts :baz
end

Example:

#good

do_something do |used, _unused|
  puts used
end

do_something do
  puts :foo
end

define_method(:foo) do |_bar|
  puts :baz
end

Line is too long. [85/80]
Open

    #   put your bucket name in this file, instead of adding it to the code directly.
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

Line is too long. [88/80]
Open

    # * +bucket+: This is the name of the S3 bucket that will store your files. Remember
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

Line is too long. [89/80]
Open

    # until +save+ is called on the record. Likewise, if the attribute is set to +nil+ is
Severity: Minor
Found in lib/paperclip.rb by rubocop

Line is too long. [94/80]
Open

    #   just an absolute path is sufficient. The leading slash *must* be included manually for
Severity: Minor
Found in lib/paperclip.rb by rubocop

Line is too long. [90/80]
Open

    # * +styles+: A hash of thumbnail styles and their geometries. You can find more about
Severity: Minor
Found in lib/paperclip.rb by rubocop

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Open

require 'paperclip/version'
Severity: Minor
Found in lib/paperclip.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Open

require 'paperclip/tempfile_factory'
Severity: Minor
Found in lib/paperclip.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Freeze mutable objects assigned to constants.
Open

    SENSIBLE_DEFAULT = "application/octet-stream"

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Line is too long. [89/80]
Open

    #   to a YAML file containing the +access_key_id+ and +secret_access_key+ that Amazon
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

Line is too long. [81/80]
Open

    # * +s3_headers+: A hash of headers or a Proc. You may specify a hash such as
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

Line is too long. [89/80]
Open

    # * +url+: The full URL of where the attachment is publicly accessible. This can just
Severity: Minor
Found in lib/paperclip.rb by rubocop

Line is too long. [91/80]
Open

    #   that can control permissions. You can specify the full domain and path, but usually
Severity: Minor
Found in lib/paperclip.rb by rubocop

Line is too long. [88/80]
Open

    #     has_attached_file :avatar, :default_url => "/images/default_:style_avatar.png"
Severity: Minor
Found in lib/paperclip.rb by rubocop

Line is too long. [93/80]
Open

    # * +preserve_files+: Keep the existing attachment files in all cases, even if the parent
Severity: Minor
Found in lib/paperclip.rb by rubocop

Line is too long. [90/80]
Open

    # * +storage+: Chooses the storage backend where the files will be stored. The current
Severity: Minor
Found in lib/paperclip.rb by rubocop

Line is too long. [108/80]
Open

    #   documentation for Paperclip::Storage::Filesystem, Paperclip::Storage::Fog and Paperclip::Storage::S3
Severity: Minor
Found in lib/paperclip.rb by rubocop
Severity
Category
Status
Source
Language