Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
V8033. Two similar code fragments...
menu mobile close menu
Additional information
toggle menu Contents

V8033. Two similar code fragments were found. A second fragment may contain a typo.

Aug 06 2026

The analyzer has detected a possible typo: the code contains an identifier (local variable, field, parameter, or function) that should likely be replaced with a different identifier. This finding is based on the presence of a structurally similar code snippet that may have been used as a template when creating the current one.

The example N1:

if currentUser != nil 
{ 
  updateProfile(currentUser)
  sendNotification(currentUser)
} 
if newUser != nil 
{ 
  updateProfile(newUser)
  sendNotification(currentUser)
}

In the second if statement, the currentUser variable should be replaced with newUser. The code can be fixed in the following way:

if currentUser != nil 
{ 
  updateProfile(currentUser)
  sendNotification(currentUser)
} 
if newUser != nil 
{ 
  updateProfile(newUser)
  sendNotification(newUser)
}

The example N2:

if FindMin(xCoords) < FindMin(yCoords) {
  minBoundary = FindMin(xCoords)
} else {
  minBoundary = FindMin(yCoords)
}

if FindMax(xCoords) < FindMax(yCoords) {
  maxBoundary = FindMin(yCoords)          // <=
} else {
  maxBoundary = FindMax(xCoords)
}

In the then branch of the second if statement, FindMax should be called instead of FindMin. The code can be fixed in the following way:

if FindMin(xCoords) < FindMin(yCoords) {
  minBoundary = FindMin(xCoords)
} else {
  minBoundary = FindMin(yCoords)
}

if FindMax(xCoords) < FindMax(yCoords) {
  maxBoundary = FindMax(yCoords)
} else {
  maxBoundary = FindMax(xCoords)
}