Copy-Paste
V3003 The use of ‘if (A) {…} else if (A) {…}’ pattern was detected. There is a probability of logical error presence. Check lines: 418, 422. txtserializerwriter.cs 418
public int Compare(GlyphRun a, GlyphRun b) { .... if (aPoint.Y > bPoint.Y) { return -1; } else if (aPoint.Y > bPoint.Y) { result = 1; } else if (aPoint.X < bPoint.X) { result = -1; } else if (aPoint.X > bPoint.X) { result = 1; } .... }
The condition has two similar conditions which is an error. In this case it is hard to say how the correct code should be like. Perhaps, in the first and in the second case different operators ‘<‘ and ‘>’ should be used to compare variables.
Please click here to see more bugs from this project.