About the File-Matching Criteria for the Import

Code Insight 2021 R2

When configuring the import to create new file associations in target inventory or to mark files in the target project codebase as reviewed, you must define the file-matching criteria needed by the import to compare files in the import data file with the target codebase files. Target files that match files in the import data file are eligible for either of these import functions.

The file path and the file MD5 value are the key criteria used to locate target codebase files that match files in the import data file. When the MD5 value is used as a criterion, the MD5 for a file in the import data file must have an exact MD5 match in the target codebase. However, when the file path is used as a criterion, the file-matching process can apply various rules.

For more information, see the following sections:

About File-Path Processing During the Import
Available File-Matching Criteria

About File-Path Processing During the Import

When the file path is used as a criterion for locating a matching file, the import process internally subtracts the scan root path from the absolute path of codebase files in the import data file and in the target project. The result is the complete file path for a given file, as illustrated in these examples:

Absolute file path/home/fnci/scanRoot/1/ePortal-1.3/src/gettext.c 
Root path/home/fnci/scanRoot/1/ 
Complete File path/ePortal-1.3/src/gettext.c 

Then, based on the file-path criterion selected by the user, the import locates matching files by searching complete file paths, partial paths, or simply file names. The following examples illustrate a complete path in comparison with a partial path or file name:

Complete path/ePortal-1.3/copy1/src/gettext.c 
Partial path/copy1/src/gettext.c or /src/gettext.c
File namegettext.c

Available File-Matching Criteria

The following describes the available options for the File Matching Criteria field used by the import to locate file matches between the import data file and the target project codebase.

Options to Define File-Matching Criteria

Option

Description

Check only the file MD5

A file’s MD5 value in the import data file must match an MD5 in the target project codebase.

Check only the file name

The name of the file in the import data file must match a file name in the target project codebase. (No path is compared in the file-matching process.)

Check only the complete path

The complete path of a file (including the file name) in the import data file must match a complete file path in the target project codebase.

Check only the partial path

A file’s partial path (including of the file name) in the import data file must match the partial path of a file in the target project codebase.

For this criterion, you must also specify the directory depth of the partial path. See the ...to n directories above the file field description in the previous table, Import Project Data Dialog.

The partial-path depth enables the import to match files when the codebase location is different between the target project codebase and the project codebase whose scanned results are included in the import data file.

Check the file MD5 and file name

The MD5 and name of a file in the import data file must match the MD5 and name of a file in the target project codebase.

Check the file MD5 and the complete file path

A file’s MD5 value and complete path (including the file name) in the import data file must match the MD5 and complete path of a file in the target project codebase.

Check the file MD5 and the partial file path

A file’s MD5 value and partial path (including the file name) in the import data file must match the MD5 and partial path of a file in the target project codebase.

For this criterion, you must also specify the directory depth of the partial path. See the ...to n directories above the file field description in the previous table, Import Project Data Dialog.

The partial-path depth enables the import to match files when the codebase location is different between the target project codebase and the project codebase whose scanned results are included in the import data file.