Lucky hour! Grab a free trial license — offer ends in 00:59:58. Claim now
The analyzer has detected that the then branch of the if statement is never executed. This happens because the code already contains an if statement with the same condition, which includes an unconditional return in the then branch. This situation may indicate a logical error in the program or that the second if statement is redundant.
Look at the example of the incorrect code:
if l >= 0x06C0 && l <= 0x06CE {
return true
}
if l == 0x06D5 { // <=
return true
}
if l >= 0x0905 && l <= 0x0939 {
return true
}
if l == 0x06D5 { // <=
return true
}
if l >= 0x0985 && l <= 0x098C {
return true
}
In this case, the l == 0x06D5 condition is duplicated, and fixing the code only requires removing one of the checks. However, it is also possible that the second check was meant to be compared to a different value than the first.
The fixed code:
if l >= 0x06C0 && l <= 0x06CE {
return true
}
if l == 0x06D5 {
return true
}
if l >= 0x0905 && l <= 0x0939 {
return true
}
if l >= 0x0985 && l <= 0x098C {
return true
}
This diagnostic is classified as:
You can look at examples of errors detected by the V8014 diagnostic. |
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders: