
org.sonar.l10n.java.rules.squid.S1481.html Maven / Gradle / Ivy
If a local variable is declared but not used in the program, it can be considered dead code and should therefore be removed.
This will improve maintainability because developers will not wonder what the variable is used for.
Noncompliant Code Example
public int compute(int a){
int foo = 6;
return a * 4;
}
Compliant Solution
public int compute(int a){
return a * 4;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy