public void processParentCoverage(CodeCoverageMetrics parentCoverage,String baseCommit,String branchName){
  if (parentCoverage == null) {
    logger.info(UBERALLS_TAG,"unable to find coverage for parent commit");
    return;
  }
  Float lineCoveragePercent=currentCoverage.getLineCoveragePercent();
  logger.info(UBERALLS_TAG,"line coverage: " + lineCoveragePercent);
  logger.info(UBERALLS_TAG,"found parent coverage as " + parentCoverage.getLineCoveragePercent());
  float coverageDelta=lineCoveragePercent - parentCoverage.getLineCoveragePercent();
  String coverageDeltaDisplay=String.format("%.3f",coverageDelta);
  String lineCoverageDisplay=String.format("%.3f",lineCoveragePercent);
  if (coverageDelta > 0) {
    comment.append("Coverage increased (+" + coverageDeltaDisplay + "%) to "+ lineCoverageDisplay+ "%");
  }
 else   if (coverageDelta < 0) {
    comment.append("Coverage decreased (" + coverageDeltaDisplay + "%) to "+ lineCoverageDisplay+ "%");
  }
 else {
    comment.append("Coverage remained the same (" + lineCoverageDisplay + "%)");
  }
  comment.append(" when pulling **" + branchName + "** into ");
  comment.append(baseCommit.substring(0,7));
  comment.append(".");
}

public void processParentCoverage ( CodeCoverageMetrics parentCoverage , String baseCommit , String branchName ) { if ( parentCoverage == null ) { logger . info ( UBERALLS_TAG , "unable to find coverage for parent commit" ) ; return ; } Float lineCoveragePercent = currentCoverage . getLineCoveragePercent ( ) ; logger . info ( UBERALLS_TAG , "line coverage: " + lineCoveragePercent ) ; logger . info ( UBERALLS_TAG , "found parent coverage as " + parentCoverage . getLineCoveragePercent ( ) ) ; float coverageDelta = lineCoveragePercent - parentCoverage . getLineCoveragePercent ( ) ; String coverageDeltaDisplay = String . format ( "%.3f" , coverageDelta ) ; String lineCoverageDisplay = String . format ( "%.3f" , lineCoveragePercent ) ; if ( coverageDelta > 0 ) { comment . append ( "Coverage increased (+" + coverageDeltaDisplay + "%) to " + lineCoverageDisplay + "%" ) ; } else if ( coverageDelta < 0 ) { comment . append ( "Coverage decreased (" + coverageDeltaDisplay + "%) to " + lineCoverageDisplay + "%" ) ; } else { comment . append ( "Coverage remained the same (" + lineCoverageDisplay + "%)" ) ; } comment . append ( " when pulling **" + branchName + "** into " ) ; comment . append ( baseCommit . substring ( 0 , 7 ) ) ; comment . append ( "." ) ; }
query uberalls for parent coverage and add appropriate comment
