Our website uses cookies to enhance your browsing experience.
Accept
to the top

Webinar: Integrating SAST into DevSecOps - 19.03

>
>
>
Examples of errors detected by the...

Examples of errors detected by the V6123 diagnostic

V6123. Modified value of the operand is not used after the increment/decrement operation.


OpenAPI Generator

V6123 Modified value of the operand is not used after the increment operation. AbstractCSharpCodegen.java 780


private String patchPropertyName(
  CodegenModel model,
  CodegenProperty property,
  String value, Set<String> composedPropertyNames
) {
  ....
  if (composedPropertyNames != null) {
    String tmpName = name;
    long count = model.allVars.stream()
                              .map(v -> v.name)
                              .filter(n -> n.equals(tmpName))
                              .count() + composedPropertyNames.stream()
                              .filter(n -> n.equals(tmpName))
                              .count();
    if (count > 0) {
      name = name + count++;  // <=
    }
    composedPropertyNames.add(name);
  }
  return name;
}