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;
}