Example: Defining variables

To share assessment data, you must define the appropriate variables. The example in this topic illustrates the need for a variable.

User Joe scans on computer A, where all source code exists under the directory C:\dev\my_code. Joe wants to save his scan results to a file and share it with Bill. Bill uses computer B and has the same code that Joe scanned under directory C:\code\bills_code. Without variables, the assessment file will reference all of the source files with absolute paths starting with C:\dev\my_code. If Bill opens this assessment file on computer B, AppScan® Source for Analysis cannot locate the source files since they exist under C:\code\bills_code on computer B.

Solution

Both Joe and Bill should create a variable that points to the root of the source code. Joe creates a variable in AppScan® Source for Analysis named SRC_ROOT, and gives it a value of C:\dev\my_code. This variable is local to Joe's AppScan® Source for Analysis installation. Joe then tells Bill the variable name (SRC_ROOT) and the location that it points to. Bill then creates a variable named SRC_ROOT with a value of C:\code\bills_code, in his AppScan® Source for Analysis. When Joe saves his scan, the variable SRC_ROOT replaces the path C:\dev\my_code. When Bill opens the assessment file that he received from Joe, C:\code\bills_code substitutes for the SRC_ROOT variable.