View Source Credo.Check.Warning.OperationWithConstantResult (Credo v1.7.0)
This check has a base priority of high
and works with any version of Elixir.
explanation
Explanation
Some numerical operations always yield the same result and therefore make little sense in production code.
Examples:
x * 1 # always returns x
x * 0 # always returns 0
In practice they are likely the result of a debugging session or were made by mistake.
check-specific-parameters
Check-Specific Parameters
There are no specific parameters for this check.
general-parameters
General Parameters
Like with all checks, general params can be applied.
Parameters can be configured via the .credo.exs
config file.