Thursday, December 23, 2021

HP Fortify scan - exclude files

 HOWTO

 

 

 


-exclude

 

Removes files from the list of files to translate. Separate multiple file

<file_specifiers>

 

paths with semicolons (Windows) or colons (non-Windows systems).

 

 

See "Specifying Files and Directories" on page 125 for more

 

 

information on how to use file specifiers.

 

 

For example:

 

 

 

 

 

 

sourceanalyzer –cp "**/*.jar" "**/*"

 

 

 

-exclude "**/Test/*.java"

 

 

 

 

 

 

 

This example excludes all Java files in any Test subdirectory.

 

 

 

 

 

Note: When you integrate the translation with a compiler or a

 

 

 

build tool, Fortify Static Code Analyzer translates all source files

 

 

 

that the compiler or build tool processes even if they are specified

 

 

 

with this option.

 

 

 

 

 

 

 

Equivalent Property Name:

 

 

com.fortify.sca.exclude

 

 

 

Specifying Files and Directories

File specifiers are expressions that allow you to pass a long list of files or a directory to Fortify Static Code Analyzer using wildcard characters. Fortify Static Code Analyzer recognizes two types of wildcard characters: a single asterisk character (*) matches part of a file name, and double asterisk characters (**) recursively matches directories. You can specify one or more files, one or more file specifiers, or a combination of files and file specifiers.

<files> | <file_dir_specifiers>

Note: File specifiers do not apply to C, C++, or Objective-C++.

The following table describes examples of file and directory specifiers.

File / Directory Specifier

Description

 

 

<dir>

Matches all files in the named directory and any subdirectories

<dir>/**/*

or the named directory when used for a directory parameter.

 

 

 

<dir>/**/Example.java

Matches any file named Example.java found in the named

 

directory or any subdirectories.

 

 

<dir>/*.java

Matches any file with the specified extension found in the

<dir>/*.jar

named directory.

 

 

 

<dir>/**/*.kt

Matches any file with the specified extension found in the

<dir>/**/*.jar

named directory or any subdirectories.

 

 

 

<dir>/**/beta/**

Matches all directories and files found in the named directory

 

that have beta in the path, including beta as a file name.

 

 

<dir>/**/classes/

Matches all directories and files with the name classes found

 

in the named directory and any subdirectories.

 

 

**/test/**

Matches all files in the current directory tree that have a test

 

element in the path, including test as a file name.

 

 

**/webgoat/*

Matches all files in any webgoat directory in the current

 

directory tree.

 

Matches:

 

/src/main/java/org/owasp/webgoat

 

 

 

No comments:

Post a Comment