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

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
>
Examples of errors detected by the V601…

Examples of errors detected by the V6016 diagnostic

V6016. Suspicious access to element by a constant index inside a loop.


Bouncy Castle

V6016 Suspicious access to element of 'fp.p' object by a constant index inside a loop. ECPointTest.java 281


/**
 * Calls <code>implTestAllPoints()</code> for the small literature curves,
 * both for <code>Fp</code> and <code>F2m</code>.
 */
public void testAllPoints()
{
  for (int i = 0; i < fp.p.length; i++)
  {
    implTestAllPoints(fp.p[0], fp.infinity);
  }

  for (int i = 0; i < f2m.p.length; i++)
  {
    implTestAllPoints(f2m.p[0], f2m.infinity);
  }
}

Similar errors can be found in some other places:

  • V6016 Suspicious access to element of 'f2m.p' object by a constant index inside a loop. ECPointTest.java 286

Apache Dubbo

V6016 Suspicious access to element of 'types' object by a constant index inside a loop. RpcUtils.java(153)


public static Class<?>[] getParameterTypes(Invocation invocation) {
  if ($INVOKE.equals(invocation.getMethodName())
            && invocation.getArguments() != null
            && invocation.getArguments().length > 1
            && invocation.getArguments()[1] instanceof String[]) {
    String[] types = (String[]) invocation.getArguments()[1];
    if (types == null) {
      return new Class<?>[0];
    }
    Class<?>[] parameterTypes = new Class<?>[types.length];
    for (int i = 0; i < types.length; i++) {
      parameterTypes[i] = ReflectUtils.forName(types[0]);      // <=
    }
    return parameterTypes;
  }
  return invocation.getParameterTypes();
}