Examples of errors detected by the V6003 diagnostic


V6003. The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence.


Elasticsearch

V6003 The use of 'if (A) {....} else if (A) {....}' pattern was detected. There is a probability of logical error presence. MockScriptEngine.java(94), MockScriptEngine.java(105)


@Override
public <T> T compile(....) {
  ....
  if (context.instanceClazz.equals(FieldScript.class)) {
    ....
  } else if (context.instanceClazz.equals(FieldScript.class)) {
    ....
  } else if(context.instanceClazz.equals(TermsSetQueryScript.class)) {
    ....
  } else if (context.instanceClazz.equals(NumberSortScript.class))
  ....
}


Bugs Found

Checked Projects
354
Collected Errors
13 290