thoughtbot/paperclip

View on GitHub

Showing 1,009 of 1,009 total issues

Space missing after comma.
Open

        path(style_name).sub(%r{\A/},'')
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, }

Space missing after comma.
Open

        http_headers.inject({}) do |headers,(name,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. [87/80]
Open

    #   In which case, those access keys will be used in all environments. You can also
Severity: Minor
Found in lib/paperclip/storage/s3.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

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. [91/80]
Open

    #   to all of the thumbnails being generated. If you specify options for the :original,
Severity: Minor
Found in lib/paperclip.rb by rubocop

Align join with attachment.path(style). on line 164.
Open

            join("/").
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

This cop checks the indentation of the method name part in method calls that span more than one line.

Example: EnforcedStyle: aligned

# bad
while myvariable
.b
  # do something
end

# good
while myvariable
      .b
  # do something
end

# good
Thing.a
     .b
     .c

Example: EnforcedStyle: indented

# good
while myvariable
  .b

  # do something
end

Example: EnforcedStyle: indentedrelativeto_receiver

# good
while myvariable
        .a
        .b

  # do something
end

# good
myvariable = Thing
               .a
               .b
               .c

Operator || should be surrounded by a single space.
Open

          @s3_options     = @options[:s3_options]     || {}
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space inside } missing.
Open

        storage_class = {:default => storage_class} unless storage_class.respond_to?(:merge)
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: space

# The `space` style enforces that hash literals have
# surrounding space.

# bad
h = {a: 1, b: 2}

# good
h = { a: 1, b: 2 }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that hash literals have
# no surrounding space.

# bad
h = { a: 1, b: 2 }

# good
h = {a: 1, b: 2}

Example: EnforcedStyle: compact

# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.

# bad
h = { a: { b: 2 } }

# good
h = { a: { b: 2 }}

Line is too long. [93/80]
Open

    #   {'Expires' => 1.year.from_now.httpdate}. If you use a Proc, headers are determined at
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. [88/80]
Open

    # * +s3_host_alias+: The fully-qualified domain name (FQDN) that is the alias to the
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

Line is too long. [90/80]
Open

    # The attribute returns a Paperclip::Attachment object which handles the management of
Severity: Minor
Found in lib/paperclip.rb by rubocop

Line is too long. [91/80]
Open

    #   to a command line error. This will override the global setting for this attachment.
Severity: Minor
Found in lib/paperclip.rb by rubocop

Line is too long. [93/80]
Open

    #   it would be best if you did not specify destructive options, as the intent of keeping
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/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"

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

require 'paperclip/io_adapters/uploaded_file_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"

Use 2 (not 0) spaces for indentation.
Open

        retries = 0
Severity: Minor
Found in lib/paperclip/storage/s3.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

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, }
Severity
Category
Status
Source
Language