thoughtbot/paperclip

View on GitHub
lib/paperclip/tempfile.rb

Summary

Maintainability
A
0 mins
Test Coverage

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

      set_encoding('ASCII-8BIT')
Severity: Minor
Found in lib/paperclip/tempfile.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"

Do not use parallel assignment.
Open

          prefix, suffix = prefix_suffix, ''
Severity: Minor
Found in lib/paperclip/tempfile.rb by rubocop

Checks for simple usages of parallel assignment. This will only complain when the number of variables being assigned matched the number of assigning variables.

Example:

# bad
a, b, c = 1, 2, 3
a, b, c = [1, 2, 3]

# good
one, two = *foo
a, b = foo()
a, b = b, a

a = 1
b = 2
c = 3

Useless assignment to variable - path.
Open

        path = "#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}-#{n}#{suffix}"
Severity: Minor
Found in lib/paperclip/tempfile.rb by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

Line is too long. [83/80]
Open

          raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
Severity: Minor
Found in lib/paperclip/tempfile.rb by rubocop

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

          prefix, suffix = prefix_suffix, ''
Severity: Minor
Found in lib/paperclip/tempfile.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"

There are no issues that match your filters.

Category
Status