Scanning the source files
After you prepare all the source files, you can start to scan the source files and check the scan results from log files.
-
Before you scan the source files, make sure that you prepare all the source files in a single directory and transfer them over to the Wazi Analyze container. For more information, see Preparing the source files to be scanned.
Note:The following instructions assume that you scan the source files from the default project. If you use the other projects that you created, you need to replace the project directory or name with your project name.
The default project can be scanned for only COBOL, PL/I, Assembler, and
C
applications. If you want to scan a Java™ application, you will need to create a new Java project. For more information, see Scanning a Java application. - Start the container and launch the container terminal. For more information, see Deploying Wazi Analyze.
- Optional: Copy the source files from the directory that you have mounted with the local shared
directory into the default directory to be scanned. The default scan directory is
/home/wazi/data/project/source.
You only need to do this step if you have not transferred the source files into the default scan directory yet.cp <path>/<container-shared-directory>/* /home/wazi/data/project/source
- Run the following command to scan the source
files.
wa-scan.sh <project-name> <dat-file-path>
<project-name>
is an optional parameter to specify the name of the project that you are scanning. If the parameter is not specified, the default project is scanned.<dat-file-path>
is an optional parameter to specify the absolute path and the name of the configuration file (.dat
). If the parameter is not specified, the default path is used to find the configuration file. The default path is /home/wazi/data/<project-name>/<project-name>.dat.For example, to scan the test project and use thetest.dat
file in the /home/wazi/ directory as the configuration file, run the following command:wa-scan.sh test /home/wazi/test.dat
The scan results are in the sub-directories of /home/wazi/data/<project-name>.
- Start the servers to view if there are artifacts that missing from the scanned source directory. For more information, see Starting up and shutting down the server.
- View the missing artifacts report and add all the missing artifacts into the source
directory of the project. For more information, see Viewing the missing artifacts report.Note: The missing artifacts report is to assist you in checking if there are any include files or programs that are missing from the source directory. You can check
Scan.log
for the complete list of scan results. - Optional: Check the complete scan results from the log files by running the following commands.
You can find two log files available.Note:
- You can use any text editor to view or edit the file.
- If you use the VI editor, you can run the following command to open the files.
- To view the summary of the scan error log, run the following
command.
vi home/wazi/data/<project-name>/<project-name>.log
- To view the detailed information of the scan log, run the following
command.
It is recommended to view thevi home/wazi/data/<project-name>/Output/Scan.log
Scan.log
to get all the detailed information.
You can use the following keys to change the editing mode of VI editor:- Press i to go to edit mode.
- Press Esc + :wq to save and exit.
- Press Esc + :q! to exit without saving.
- To view the summary of the scan error log, run the following
command.
- Fix the errors that are reported in the
Scan.log
file. For more information about how to fix common scan errors, see Understanding the scanning messages in the scan log file.Notes:- It is suggested to try to fix all the
S-EMSG220
error message first. Because the other error messages might be caused by any missing files reported by theS-EMSG220
error message. - Log data is displayed in the following columns:
source_name
- The name of the source file that contains error.
source_type
- The type of source file that contains error.
error_number
- The error message number. The error message for scanning is started with
S-EMSG
. Pay attention toEMSG220
indicating that the file that is referenced in the source code cannot be found or cannot be opened. If it cannot be found, you can fix it by putting the mentioned file into the source directory. If it cannot be opened, it could be because the scanner does not know the file extension. You can consider changing the file extension to a standard extension. For more information, see Preparing the source files to be scanned. error_text
- The description of the error.
source_line_count
- The line number in the source file where the error occurs.
source_file_name
- The name of the source file where the error occurs.
source_file_type
- The type of the source file where the error occurs.
date
- The date and time when the error is found.
- It is suggested to try to fix all the
- Repeat step 2 to 7 until you see no errors.
- View the scan results. For more information, see Viewing impact analysis results.
What to do next
To continue with the tasks for getting started with Wazi Analyze, see Checklist for getting started.