iZettle/ninetails

View on GitHub
app/components/ninetails/property_type.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use Hash#key? instead of Hash#has_key?.
Open

      if values.is_a?(Hash) && !values.with_indifferent_access.has_key?(:reference)

This cop (by default) checks for uses of methods Hash#haskey? and Hash#hasvalue? where it enforces Hash#key? and Hash#value? It is configurable to enforce the inverse, using verbose method names also.

Example: EnforcedStyle: short (default)

# bad Hash#haskey? Hash#hasvalue?

# good Hash#key? Hash#value?

Example: EnforcedStyle: verbose

# bad Hash#key? Hash#value?

# good Hash#haskey? Hash#hasvalue?

Method Ninetails::PropertyType#serialized_values= is defined at both app/components/ninetails/property_type.rb:3 and app/components/ninetails/property_type.rb:19.
Open

    def serialized_values=(values)

This cop checks for duplicated instance (or singleton) method definitions.

Example:

# bad

def duplicated
  1
end

def duplicated
  2
end

Example:

# bad

def duplicated
  1
end

alias duplicated other_duplicated

Example:

# good

def duplicated
  1
end

def other_duplicated
  2
end

There are no issues that match your filters.

Category
Status