ddd-ruby/contracts.ruby

View on GitHub
lib/contracts/contract/validators.rb

Summary

Maintainability
A
0 mins
Test Coverage

TODO found
Open

      # TODO: account for these errors too
Severity: Minor
Found in lib/contracts/contract/validators.rb by fixme

Avoid comparing a variable with multiple items in a conditional, use Array#include? instead.
Open

      return :class if klass == Class || klass == Module

This cop checks against comparing a variable with multiple items, where Array#include? could be used instead to avoid code repetition.

Example:

# bad
a = 'a'
foo if a == 'a' || a == 'b' || a == 'c'

# good
a = 'a'
foo if ['a', 'b', 'c'].include?(a)

There are no issues that match your filters.

Category
Status