Unanalyzed duplicates

Sider Scan detects “Duplicate code” if it has more than 5 lines of duplicate code in the source code. “Duplicate code” includes not only code pairs that match exactly, but also variable and function names that have been changed, additional lines, etc.

Example of a code that is detected as a duplicate code although the namespace and method name have been changed.

As described above, Sider Scan detects not only exact match code, but also similar code, which can provide useful information to developers, such as “Possible misses” or “inconsistent code pattern”. However, on the other hand, because it also detects similar code, a large amount of duplicate code may be detected in a particular source code. In many cases, such a large amount of duplicate code is not so important to the developer. Therefore, when the number of duplicate codes exceeds a threshold, Sider Scan skips the analysis for that duplicate code and moves on to the next duplicate code. When duplicate code analysis has been skipped, you will receive a following message from Sider Scan via e-mail.

An example of a source code that would cause Sider Scan to terminate the analysis process is as follows:

  SWIGEXPORT jint JNICALL Java_openglJNI_GL_1GLEXT_1VERSION_1get(JNIEnv *jenv, jclass jcls)
  {
    jint jresult = 0;
    int result;

    (void)jenv;
    (void)jcls;
    result = (int)(20210420);
    jresult = (jint)result;
    return jresult;
  }

  SWIGEXPORT jint JNICALL Java_openglJNI_GL_1VERSION_11_12_1get(JNIEnv *jenv, jclass jcls)
  {
    jint jresult = 0;
    int result;

    (void)jenv;
    (void)jcls;
    result = (int)(1);
    jresult = (jint)result;
    return jresult;
  }

  SWIGEXPORT jint JNICALL Java_openglJNI_GL_1UNSIGNED_1BYTE_13_13_12_1get(JNIEnv *jenv, jclass jcls)
  {
    jint jresult = 0;
    int result;

    (void)jenv;
    (void)jcls;
    result = (int)(0x8032);
    jresult = (jint)result;
    return jresult;
  }

  SWIGEXPORT jint JNICALL Java_openglJNI_GL_1UNSIGNED_1SHORT_14_14_14_14_1get(JNIEnv *jenv, jclass jcls)
  {
    jint jresult = 0;
    int result;

    (void)jenv;
    (void)jcls;
    result = (int)(0x8033);
    jresult = (jint)result;
    return jresult;
  }

  SWIGEXPORT jint JNICALL Java_openglJNI_GL_1UNSIGNED_1SHORT_15_15_15_11_1get(JNIEnv *jenv, jclass jcls)
  {
    jint jresult = 0;
    int result;

    (void)jenv;
    (void)jcls;
    result = (int)(0x8034);
    jresult = (jint)result;
    return jresult;
  }
// After this line, more than 1000 identical function definitions, differing only in some constants, follow.

Like this example, in the case of source code in which variables and literals change little by little in relatively small blocks, the number of duplicate codes detected is so large that the analysis process is interrupted. However, since Sider Scan does not make a skip decision on a file-by-file basis, but decision on each duplicate pattern, duplicate codes of other patterns included in this file will be detected if the number of duplicate codes is not too large, and “Possible misses” or ” inconsistent code pattern ” may be reported.