
org.sonar.l10n.javascript.rules.javascript.DuplicateFunctionArgument.html Maven / Gradle / Ivy
Function arguments should all have different names to prevent any ambiguity. Indeed, if arguments have the same name, the last duplicated argument hides all the previous arguments with the same name. This hiding makes no sense, reduces understandability and maintainability, and obviously can be error prone.
Noncompliant Code Example
function compute(a, a, c) { // Noncompliant
}
Compliant Solution
function compute(a, b, c) { // Compliant
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy