railsdog/spree_shipping_labels

View on GitHub
app/models/spree/label.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use nested module/class definitions instead of compact style.
Open

class Spree::Label < Spree::Base
Severity: Minor
Found in app/models/spree/label.rb by rubocop

This cop checks the style of children definitions at classes and modules. Basically there are two different styles:

Example: EnforcedStyle: nested (default)

# good
# have each child on its own line
class Foo
  class Bar
  end
end

Example: EnforcedStyle: compact

# good
# combine definitions as much as possible
class Foo::Bar
end

The compact style is only forced for classes/modules with one child.

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

  validates_attachment_content_type :label_image, content_type: ["image/gif", "image/jpeg", "image/png"]
Severity: Minor
Found in app/models/spree/label.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"

Line is too long. [104/80]
Open

  validates_attachment_content_type :label_image, content_type: ["image/gif", "image/jpeg", "image/png"]
Severity: Minor
Found in app/models/spree/label.rb by rubocop

Line is too long. [81/80]
Open

# A label stores the generated label. The system attempts to "print" it (download
Severity: Minor
Found in app/models/spree/label.rb by rubocop

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

  validates_attachment_content_type :label_image, content_type: ["image/gif", "image/jpeg", "image/png"]
Severity: Minor
Found in app/models/spree/label.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 single-quoted strings when you don't need string interpolation or special symbols.
Open

  validates_attachment_content_type :label_image, content_type: ["image/gif", "image/jpeg", "image/png"]
Severity: Minor
Found in app/models/spree/label.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