code: private int runScan(String reportDirectory, String outputFormat, String applicationName, String[] files,
              String[] excludes, int symLinkDepth, int cvssFailScore) throws DatabaseException,
              ExceptionCollection, ReportException {
          Engine engine = null;
          try {
              final List<String> antStylePaths = getPaths(files);
              final Set<File> paths = scanAntStylePaths(antStylePaths, symLinkDepth, excludes);
  
              engine = new Engine(settings);
              engine.scan(paths);
  
              ExceptionCollection exCol = null;
              try {
                  engine.analyzeDependencies();
              } catch (ExceptionCollection ex) {
                  if (ex.isFatal()) {
                      throw ex;
                  }
                  exCol = ex;
              }
  
              try {
                  engine.writeReports(applicationName, new File(reportDirectory), outputFormat);
              } catch (ReportException ex) {
                  if (exCol != null) {
                      exCol.addException(ex);
                      throw exCol;
                  } else {
                      throw ex;
                  }
              }
              if (exCol != null && !exCol.getExceptions().isEmpty()) {
                  throw exCol;
              }
              return determineReturnCode(engine, cvssFailScore);
          } finally {
              if (engine != null) {
                  engine.close();
              }
          }
      }
docs: Scans the specified directories and writes the dependency reports to the
  reportDirectory.
  
  @param reportDirectory the path to the directory where the reports will
  be written
  @param outputFormat the output format of the report
  @param applicationName the application name for the report
  @param files the files/directories to scan
  @param excludes the patterns for files/directories to exclude
  @param symLinkDepth the depth that symbolic links will be followed
  @param cvssFailScore the score to fail on if a vulnerability is found
  @return the exit code if there was an error
  
  @throws ReportException thrown when the report cannot be generated
  @throws DatabaseException thrown when there is an error connecting to the
  database
  @throws ExceptionCollection thrown when an exception occurs during
  analysis; there may be multiple exceptions contained within the
  collection.