Program: 98771
Project: 98771
Buggy source:
/** 
 * This function works in the following way: After choosing your report type, as set of supported graphs are given, which it is up to the user to add. Currently this is done programatically, but given my design, it should be relatively simple to make this possible to edit in the GUI. If a result is fetched and it does not contain the property to draw the graphs the report demands we simply skip it. This means you can switch report type in a job. You don't need to create a new job if you just want to change reporting mode. This method catches the PrqaReadingException, when that exception is thrown it means that the we skip the reading and continue. 
 * @param req
 * @param rsp
 * @throws IOException 
 */
public void doReportGraphs(StaplerRequest req,StaplerResponse rsp) throws IOException {
  PRQANotifier notifier=(PRQANotifier)getPublisher();
  HashMap<StatusCategory,Boolean> drawMatrix=_doDrawThresholds(req,rsp);
  if (notifier != null) {
    String className=req.getParameter("String_Node_Str");
    PRQAGraph graph=notifier.getGraph(className);
    PRQAStatusCollection collection=new PRQAStatusCollection();
    DataSetBuilder<String,ChartUtil.NumberOnlyBuildLabel> dsb=new DataSetBuilder<String,ChartUtil.NumberOnlyBuildLabel>();
    ChartUtil.NumberOnlyBuildLabel label=null;
    Double tMax=null;
    for (PRQABuildAction prqabuild=this; prqabuild != null; prqabuild=prqabuild.getPreviousAction()) {
      if (prqabuild.getResult() != null) {
        label=new ChartUtil.NumberOnlyBuildLabel(prqabuild.build);
        PRQAReading stat=prqabuild.getResult();
        for (        StatusCategory cat : graph.getCategories()) {
          Number res=null;
          try {
            PRQAComplianceStatus cs=(PRQAComplianceStatus)stat;
            if (cat.equals(StatusCategory.Messages)) {
              res=cs.getMessagesWithinThreshold();
            }
 else {
              res=stat.getReadout(cat);
            }
          }
 catch (          PrqaException ex) {
            continue;
          }
          if (drawMatrix.containsKey(cat) && drawMatrix.get(cat)) {
            Number threshold=prqabuild.getThreshold(cat);
            if (threshold != null) {
              if (tMax == null) {
                tMax=threshold.doubleValue();
              }
 else               if (tMax.doubleValue() < threshold.doubleValue()) {
                tMax=threshold.doubleValue();
              }
              dsb.add(threshold,String.format("String_Node_Str",cat.toString()),label);
            }
          }
          dsb.add(res,cat.toString(),label);
          collection.add(stat);
        }
      }
    }
    graph.setData(collection);
    graph.drawGraph(req,rsp,dsb,tMax);
  }
}

Fixed version (ground truth):
/** 
 * This function works in the following way: After choosing your report type, as set of supported graphs are given, which it is up to the user to add. Currently this is done programatically, but given my design, it should be relatively simple to make this possible to edit in the GUI. If a result is fetched and it does not contain the property to draw the graphs the report demands we simply skip it. This means you can switch report type in a job. You don't need to create a new job if you just want to change reporting mode. This method catches the PrqaReadingException, when that exception is thrown it means that the we skip the reading and continue. 
 * @param req
 * @param rsp
 * @throws IOException 
 */
public void doReportGraphs(StaplerRequest req,StaplerResponse rsp) throws IOException {
  PRQANotifier notifier=(PRQANotifier)getPublisher();
  HashMap<StatusCategory,Boolean> drawMatrix=_doDrawThresholds(req,rsp);
  if (notifier != null) {
    Integer tSetting=Integer.parseInt(req.getParameter("String_Node_Str"));
    String className=req.getParameter("String_Node_Str");
    PRQAGraph graph=notifier.getGraph(className);
    PRQAStatusCollection collection=new PRQAStatusCollection();
    DataSetBuilder<String,ChartUtil.NumberOnlyBuildLabel> dsb=new DataSetBuilder<String,ChartUtil.NumberOnlyBuildLabel>();
    ChartUtil.NumberOnlyBuildLabel label=null;
    Double tMax=null;
    for (PRQABuildAction prqabuild=this; prqabuild != null; prqabuild=prqabuild.getPreviousAction()) {
      if (prqabuild.getResult() != null) {
        label=new ChartUtil.NumberOnlyBuildLabel(prqabuild.build);
        PRQAReading stat=prqabuild.getResult();
        for (        StatusCategory cat : graph.getCategories()) {
          Number res=null;
          try {
            PRQAComplianceStatus cs=(PRQAComplianceStatus)stat;
            if (cat.equals(StatusCategory.Messages)) {
              res=cs.getMessageCount(tSetting);
            }
 else {
              res=stat.getReadout(cat);
            }
          }
 catch (          PrqaException ex) {
            continue;
          }
          if (drawMatrix.containsKey(cat) && drawMatrix.get(cat)) {
            Number threshold=prqabuild.getThreshold(cat);
            if (threshold != null) {
              if (tMax == null) {
                tMax=threshold.doubleValue();
              }
 else               if (tMax.doubleValue() < threshold.doubleValue()) {
                tMax=threshold.doubleValue();
              }
              dsb.add(threshold,String.format("String_Node_Str",cat.toString()),label);
            }
          }
          dsb.add(res,cat.toString(),label);
          collection.add(stat);
        }
      }
    }
    graph.setData(collection);
    graph.drawGraph(req,rsp,dsb,tMax);
  }
}