@echo off REM ########################################################################### REM Script generated by HP Fortify SCA Scan Wizard (c) HP Fortify 2011 REM Created on 2017/11/29 10:45:16 REM ########################################################################### REM Generated for the following languages: REM HTML REM Java REM Javascript REM JSP J2EE REM PHP REM SQL REM XML REM ########################################################################### REM DEBUG - if set to true, runs SCA in debug mode REM SOURCEANALYZER - the name of the SCA executable REM BUILDID - the SCA build id REM LAUNCHERSWITCHES - the launcher settings that are used to invoke SCA REM ARGFILE - the name of the argument file that's extracted and passed to SCA REM MEMORY - the memory settings for SCA REM OLDFILENUMBER - this defines the file which contains the number of files within the project, it is automatically generated REM FILENOMAXDIFF - this is the percentage of difference between the number of files which will trigger a warning by the script REM ########################################################################### set DEBUG=false set SOURCEANALYZER=sourceanalyzer set FPR="Fortifystandard.fpr" set BUILDID="standard" set ARGFILE="Fortifystandard.bat.args" set MEMORY=-Xmx66343M -Xms400M -Xss24M set LAUNCHERSWITCHES="" set OLDFILENUMBER=Fortifystandard.bat.fileno set FILENOMAXDIFF=10 set PROJECTROOT0="C:\DEV\ideaIU-15.0.6\jstree\backend\standard" IF NOT EXIST %PROJECTROOT0% ( ECHO ERROR: This script is being run on a different machine than it was ECHO generated on or the targeted project has been moved. This script is ECHO configured to locate files at ECHO %PROJECTROOT0% ECHO Please modify the %%PROJECTROOT0%% variable found ECHO at the top of this script to point to the corresponding directory ECHO located on this machine. GOTO :FINISHED ) IF %DEBUG%==true set LAUNCHERSWITCHES=-debug %LAUNCHERSWITCHES% echo Extracting Arguments File echo. >Fortifystandard.bat.args SETLOCAL ENABLEDELAYEDEXPANSION IF EXIST %0 ( set SCAScriptFile=%0 ) ELSE ( set SCAScriptFile=%0.bat ) set PROJECTROOT0=%PROJECTROOT0:)=^)% FOR /f "delims=" %%a IN ('findstr /B /C:"REM ARGS" %SCAScriptFile%' ) DO ( set argVal=%%a set argVal=!argVal:PROJECTROOT0_MARKER=%PROJECTROOT0:~1,-1%! echo !argVal:~9! >> %ARGFILE% ) ENDLOCAL REM ########################################################################### echo Cleaning previous scan artifacts %SOURCEANALYZER% %MEMORY% %LAUNCHERSWITCHES% -b %BUILDID% -clean IF %ERRORLEVEL%==1 ( echo Sourceanalyzer failed, exiting GOTO :FINISHED ) REM ########################################################################### echo Running Build Integration %SOURCEANALYZER% %MEMORY% %LAUNCHERSWITCHES% -b %BUILDID% -source 1.8 mvn -f "C:\DEV\ideaIU-15.0.6\jstree\backend\standard\pom.xml" com.fortify.ps.maven.plugin:sca-maven-plugin:translate IF %ERRORLEVEL%==1 ( echo Sourceanalyzer failed, exiting GOTO :FINISHED ) REM ########################################################################### echo Translating files %SOURCEANALYZER% %MEMORY% %LAUNCHERSWITCHES% -b %BUILDID% @%ARGFILE% IF %ERRORLEVEL%==1 ( echo Sourceanalyzer failed, exiting GOTO :FINISHED ) REM ########################################################################### echo Testing Difference between Translations SETLOCAL FOR /F "delims=" %%A in ('%SOURCEANALYZER% -b %BUILDID% -show-files ^| findstr /R /N "^" ^| find /C ":" ') DO SET FILENUMBER=%%A IF NOT EXIST %OLDFILENUMBER% ( ECHO It appears to be the first time running this script, setting %OLDFILENUMBER% to %FILENUMBER% ECHO %FILENUMBER% > %OLDFILENUMBER% GOTO TESTENDED ) FOR /F "delims=" %%i IN (%OLDFILENUMBER%) DO SET OLDFILENO=%%i set /a DIFF=%OLDFILENO% * %FILENOMAXDIFF% set /a DIFF /= 100 set /a MAX=%OLDFILENO% + %DIFF% set /a MIN=%OLDFILENO% - %DIFF% IF %FILENUMBER% LSS %MIN% set SHOWWARNING=true IF %FILENUMBER% GTR %MAX% set SHOWWARNING=true IF DEFINED SHOWWARNING ( ECHO WARNING: The number of files has changed by over %FILENOMAXDIFF%%%, it is recommended ECHO that this script is regenerated with the ScanWizard ) :TESTENDED ENDLOCAL REM ########################################################################### echo Starting scan %SOURCEANALYZER% %MEMORY% %LAUNCHERSWITCHES% -b %BUILDID% -scan -f %FPR% IF %ERRORLEVEL%==1 ( echo Sourceanalyzer failed, exiting GOTO :FINISHED ) REM ########################################################################### echo Finished :FINISHED REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.htm" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.html" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.java" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.properties" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.ini" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.js" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.php" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.ctp" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.sql" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.pks" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.pkh" REM ARGS -exclude "PROJECTROOT0_MARKER\**\*.pkb" REM ARGS -exclude "PROJECTROOT0_MARKER\target\site\doxygen.config" REM ARGS "PROJECTROOT0_MARKER"