private static void updateMenus(Set<Report> toolResults,Set<String> catSet){
  StringBuffer sb=new StringBuffer();
  for (  Report toolReport : toolResults) {
    if (!(showAveOnlyMode && toolReport.isCommercial())) {
      sb.append("<li><a href=\"");
      sb.append(toolReport.getFilename());
      sb.append(".html\">");
      sb.append(toolReport.getToolNameAndVersion());
      sb.append("</a></li>");
      sb.append(System.lineSeparator());
    }
  }
  if (commercialAveScorecardFilename != null) {
    sb.append("<li><a href=\"");
    sb.append(commercialAveScorecardFilename);
    sb.append(".html\">");
    sb.append("Commercial Average");
    sb.append("</a></li>");
    sb.append(System.lineSeparator());
  }
  String toolmenu=sb.toString();
  sb=new StringBuffer();
  for (  String cat : catSet) {
    String filename="Benchmark_v" + benchmarkVersion + "_Scorecard_for_"+ cat.replace(' ','_');
    sb.append("            <li><a href=\"");
    sb.append(filename);
    sb.append(".html\">");
    sb.append(cat);
    sb.append("</a></li>");
    sb.append(System.lineSeparator());
  }
  String vulnmenu=sb.toString();
  updateMenuTemplates(toolmenu,vulnmenu);
}

private static void updateMenus ( Set < Report > toolResults , Set < String > catSet ) { StringBuffer sb = new StringBuffer ( ) ; for ( Report toolReport : toolResults ) { if ( ! ( showAveOnlyMode && toolReport . isCommercial ( ) ) ) { sb . append ( "<li><a href=\"" ) ; sb . append ( toolReport . getFilename ( ) ) ; sb . append ( ".html\">" ) ; sb . append ( toolReport . getToolNameAndVersion ( ) ) ; sb . append ( "</a></li>" ) ; sb . append ( System . lineSeparator ( ) ) ; } } if ( commercialAveScorecardFilename != null ) { sb . append ( "<li><a href=\"" ) ; sb . append ( commercialAveScorecardFilename ) ; sb . append ( ".html\">" ) ; sb . append ( "Commercial Average" ) ; sb . append ( "</a></li>" ) ; sb . append ( System . lineSeparator ( ) ) ; } String toolmenu = sb . toString ( ) ; sb = new StringBuffer ( ) ; for ( String cat : catSet ) { String filename = "Benchmark_v" + benchmarkVersion + "_Scorecard_for_" + cat . replace ( ' ' , '_' ) ; sb . append ( "            <li><a href=\"" ) ; sb . append ( filename ) ; sb . append ( ".html\">" ) ; sb . append ( cat ) ; sb . append ( "</a></li>" ) ; sb . append ( System . lineSeparator ( ) ) ; } String vulnmenu = sb . toString ( ) ; updateMenuTemplates ( toolmenu , vulnmenu ) ; }
this method updates the menus of all the scorecards previously generated so people can navigate between all the tool results .
