Examples of errors detected by the V6079 diagnostic
V6079. Value of variable is checked after use. Potential logical error is present. Check lines: N1, N2.
LanguageTool
V6079 Value of the 'darrerAdverbi' variable is checked after use. Potential logical error is present. DonarseliBeFilter.java 83
@Nullable
@Override
public RuleMatch acceptRuleMatch(
RuleMatch match,
Map<String, String> arguments,
int patternTokenPos,
AnalyzedTokenReadings[] patternTokens,
List<Integer> tokenPositions
) throws IOException {
int posWord = 0;
....
AnalyzedTokenReadings[] tokens = match.getSentence()
.getTokensWithoutWhitespace();
....
posWord = verbSynth.getLastVerbIndex() +
verbSynth.getNumPronounsAfter() + 1;
primerAdverbi = posWord;
while (
posWord < tokens.length &&
!adverbiFinal.contains(
tokens[posWord]
.getToken()
.toLowerCase()
)
) {
posWord++;
}
if (
posWord == tokens.length ||
!adverbiFinal.contains(
tokens[posWord]
.getToken()
.toLowerCase()
)
) {
return null;
}
darrerAdverbi = posWord;
String darrerAdverbiStr = tokens[darrerAdverbi].getToken(); // <=
....
if (primerAdverbi == -1 || darrerAdverbi == -1) { // <=
return null;
}
....
}
ELKI
V6079 Value of the 'splitpoint' variable is checked after use. Potential logical error is present. KernelDensityFittingTest.java(97), KernelDensityFittingTest.java(97)
public final void testFitDoubleArray() throws IOException {
....
int splitpoint = 0;
while(fulldata[splitpoint] < splitval && splitpoint < fulldata.length) {
splitpoint++;
}
....
}