inertia186/radiator

View on GitHub
lib/radiator/type/amount.rb

Summary

Maintainability
A
0 mins
Test Coverage

Missing top-level class documentation comment.
Open

    class Amount < Hive::Type::Amount
Severity: Minor
Found in lib/radiator/type/amount.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Line is too long. [120/80]
Open

          warn "[DEPRECATED] Using Radiator::Type::Amount class provided is deprecated.  Please use: Hive::Type::Amount"
Severity: Minor
Found in lib/radiator/type/amount.rb by rubocop

Line is too long. [104/80]
Open

# @deprecated Using Radiator::Type::Amount class provided is deprecated.  Please use: Hive::Type::Amount
Severity: Minor
Found in lib/radiator/type/amount.rb by rubocop

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

          warn "[DEPRECATED] Using Radiator::Type::Amount class provided is deprecated.  Please use: Hive::Type::Amount"
Severity: Minor
Found in lib/radiator/type/amount.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"

Trailing whitespace detected.
Open

          
Severity: Minor
Found in lib/radiator/type/amount.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

        unless defined? @@deprecated_warning_shown
Severity: Minor
Found in lib/radiator/type/amount.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

Replace class var @@deprecated_warning_shown with a class instance var.
Open

          @@deprecated_warning_shown = true
Severity: Minor
Found in lib/radiator/type/amount.rb by rubocop

This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.

There are no issues that match your filters.

Category
Status