dry-rb/dry-types

View on GitHub
lib/dry/types/constrained.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

When defining the === operator, name its argument other.
Open

      def ===(value)
Severity: Minor
Found in lib/dry/types/constrained.rb by rubocop

This cop makes sure that certain binary operator methods have their sole parameter named other.

Example:

# bad
def +(amount); end

# good
def +(other); end

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

        if result.success?
Severity: Minor
Found in lib/dry/types/constrained.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

There are no issues that match your filters.

Category
Status