private int determineReturnCode ( Engine engine , int cvssFailScore ) { int retCode = 0 ; //Set the exit code based on whether we found a high enough vulnerability for ( Dependency dep : engine . getDependencies ( ) ) { if ( ! dep . getVulnerabilities ( ) . isEmpty ( ) ) { for ( Vulnerability vuln : dep . getVulnerabilities ( ) ) { LOGGER . debug ( "VULNERABILITY FOUND {}" , dep . getDisplayFileName ( ) ) ; if ( ( vuln . getCvssV2 ( ) != null && vuln . getCvssV2 ( ) . getScore ( ) > cvssFailScore ) || ( vuln . getCvssV3 ( ) != null && vuln . getCvssV3 ( ) . getBaseScore ( ) > cvssFailScore ) ) { retCode = 1 ; } } } } return retCode ; }
Determines the return code based on if one of the dependencies scanned has a vulnerability with a CVSS score above the cvssFailScore .