View Source Credo.Check.Warning.OperationOnSameValues (Credo v1.7.5)
This check is enabled by default.
Learn how to disable it via
This check has a base priority of
high and works with any version of Elixir.
Operations on the same values always yield the same result and therefore make little sense in production code.
x == x # always returns true
x <= x # always returns true
x >= x # always returns true
x != x # always returns false
x > x # always returns false
y / y # always returns 1
y - y # always returns 0
In practice they are likely the result of a debugging session or were made by mistake.
There are no specific parameters for this check.
Like with all checks, general params can be applied.
Parameters can be configured via the
.credo.exs config file.