Single scan of local files

One-time scan on a specific local files from the command line.


You can perform a one-time scan on a specific local file or folder using the single scan mode. LPVS should be compiled from the source code. Please refer to the detailed guideline.

Follow the next steps:

mvn clean install
cd target/
  • Choose a specific local file or folder which is a target for the scan and run the command with flag --local.path:
java -jar lpvs-*.jar --local.path=</path/to/file/or/folder>

Example:

-jar lpvs-*.jar --local.path=test.java

Note

By default, the above commands require a pre-configured MySQL database. Use the "singlescan" profile to skip setting up a pre-configured MySQL database:

java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder>
  • Optionally, generate an HTML report and save it in a specified folder using flag --build.html.report, or PDF report using flag --build.pdf.report. Replace path/to/your/folder with the full path to the folder where you want to save the HTML/PDF report, and your_report_filename.html or your_report_filename.pdf with the desired filename for the report.
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder> --build.html.report=<your_report_filename.html>
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder> --build.pdf.report=<your_report_filename.pdf>
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder> --build.html.report=<your_report_filename.html> --build.pdf.report=<your_report_filename.pdf>

Warning

Ensure that the specified folder exists before generating the HTML report.

Examples of the command:

java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test.c
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test_folder --build.html.report=test/report.html
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test_folder --build.pdf.report=test/report.pdf
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test_folder --build.html.report=test/report.html --build.pdf.report=test/report.pdf