Package com.google.test.metric

Examples of com.google.test.metric.WeightedAverage.addValue()


                                        Cost replacementCost) {

    WeightedAverage average = costModel.createWeighedAverage();
    for (MethodCost methodCost : classCost.getMethods()) {
      Cost cost = (adjustedMethod == methodCost ? replacementCost : methodCost.getTotalCost());
      average.addValue(costModel.computeOverall(cost));
    }
    return (int) average.getAverage();
  }

  public float computeContributionFromIssue(ClassCost classCost, MethodCost violationMethodCost,
View Full Code Here


                                            ViolationCost violationCost) {
    Cost adjustedCost = violationMethodCost.getTotalCost().add(violationCost.getCost().negate());
    WeightedAverage average = costModel.createWeighedAverage();
    for (MethodCost methodCost : classCost.getMethods()) {
      Cost cost = (violationMethodCost == methodCost ? adjustedCost : methodCost.getTotalCost());
      average.addValue(costModel.computeOverall(cost));
    }
    return 1 - (int) average.getAverage() / (float) computeClass(classCost);
  }

  public float computeContributionFromMethod(ClassCost classCost, MethodCost violationMethodCost) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.