Package ch.hortis.sonar.model

Examples of ch.hortis.sonar.model.ProjectMeasure


    addMeasure( measures, Metrics.JDEPEND_PACKAGE_DEPENDENCY_CYCLES, cyclicDependencies );
    return measures;
  }

  private void addMeasure( Collection<ProjectMeasure> measures, Metrics metricEnum, double ce ) {
    ProjectMeasure measure;
    measure = new ProjectMeasure();
    measure.setMetric( loadMetric( metricEnum ) );
    measure.setValue( ce );
    measures.add( measure );
  }
View Full Code Here


  public List<ProjectMeasure> collectProjectMeasures() throws MojoExecutionException {
    List<ProjectMeasure> measures = new ArrayList<ProjectMeasure>();
    try {
      double lineRate = parseNumber( parser.executeXPath( "/coverage/@line-rate" ) );
      measures.add( new ProjectMeasure( lineCoverageMetric, convertPercentage( lineRate ) ) );
      double branchRate = parseNumber( parser.executeXPath( "/coverage/@branch-rate" ) );
      measures.add( new ProjectMeasure( branchCoverageMetric, convertPercentage( branchRate ) ) );
    } catch (Exception ex) {
      throw new MojoExecutionException( "Error during Cobertura reports parsing", ex );
    }
    return measures;
  }
View Full Code Here

    List<ProjectMeasure> measures = new ArrayList<ProjectMeasure>();
    try {
      Integer classesCount = ( (Number)ckjmXpath.evaluate("count(/ckjm/class)", ckjmDocument, XPathConstants.NUMBER ) ).intValue();
     
      Integer wmcCount = ( (Number)ckjmXpath.evaluate("sum(/ckjm/class/wmc/text())", ckjmDocument, XPathConstants.NUMBER ) ).intValue();
      measures.add( new ProjectMeasure( loadMetric( Metrics.CK_WMC ), scaleValue( wmcCount.doubleValue() / classesCount ) ) );
     
      Integer ditCount = ( (Number)ckjmXpath.evaluate("sum(/ckjm/class/dit/text())", ckjmDocument, XPathConstants.NUMBER ) ).intValue();
      measures.add( new ProjectMeasure( loadMetric( Metrics.CK_DIT), scaleValue( ditCount.doubleValue() / classesCount ) ) );
     
      Integer nocCount = ( (Number)ckjmXpath.evaluate("sum(/ckjm/class/noc/text())", ckjmDocument, XPathConstants.NUMBER ) ).intValue();
      measures.add( new ProjectMeasure( loadMetric( Metrics.CK_NOC), scaleValue( nocCount.doubleValue() / classesCount ) ) );
     
      Integer cboCount = ( (Number)ckjmXpath.evaluate("sum(/ckjm/class/cbo/text())", ckjmDocument, XPathConstants.NUMBER ) ).intValue();
      measures.add( new ProjectMeasure( loadMetric( Metrics.CK_CBO), scaleValue( cboCount.doubleValue() / classesCount ) ) );
     
      Integer rfcCount = ( (Number)ckjmXpath.evaluate("sum(/ckjm/class/rfc/text())", ckjmDocument, XPathConstants.NUMBER ) ).intValue();
      measures.add( new ProjectMeasure( loadMetric( Metrics.CK_RFC), scaleValue( rfcCount.doubleValue() / classesCount ) ) );
     
      Integer lcomCount = ( (Number)ckjmXpath.evaluate("sum(/ckjm/class/lcom/text())", ckjmDocument, XPathConstants.NUMBER ) ).intValue();
      measures.add( new ProjectMeasure( loadMetric( Metrics.CK_LCOM), scaleValue( lcomCount.doubleValue() / classesCount ) ) );
     
      Integer caCount = ( (Number)ckjmXpath.evaluate("sum(/ckjm/class/ca/text())", ckjmDocument, XPathConstants.NUMBER ) ).intValue();
      measures.add( new ProjectMeasure( loadMetric( Metrics.CK_CA), scaleValue( caCount.doubleValue() / classesCount ) ) );
     
      Integer npmCount = ( (Number)ckjmXpath.evaluate("sum(/ckjm/class/npm/text())", ckjmDocument, XPathConstants.NUMBER ) ).intValue();
      measures.add( new ProjectMeasure(loadMetricMetrics.CK_NPM), scaleValue( npmCount.doubleValue() / classesCount ) ) );
    } catch (Exception ex) {
      throw new MojoExecutionException("Error during CK report parsing", ex);
    }
   
    return measures;
View Full Code Here

TOP

Related Classes of ch.hortis.sonar.model.ProjectMeasure

Copyright © 2018 www.massapicom. 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.