Package org.sonar.api.technicaldebt.batch

Examples of org.sonar.api.technicaldebt.batch.Characteristic


        if (metric == null) {
          throw new IllegalStateException("Unknow metric with key: " + measure.getMetric().getKey());
        }
        metricId = metric.getId();
      }
      Characteristic characteristic = measure.getCharacteristic();
      Integer characteristicId = characteristic != null ? characteristic.id() : null;
      Integer personId = measure.getPersonId();
      Integer ruleId = null;
      if (measure instanceof RuleMeasure) {
        Rule rule = ruleFinder.findByKey(((RuleMeasure) measure).ruleKey());
        if (rule != null) {
View Full Code Here


    List<Measure> result = Lists.newArrayList();

    for (Object[] object : objects) {
      MeasureModel model = (MeasureModel) object[0];
      Integer characteristicId = model.getCharacteristicId();
      Characteristic characteristic = techDebtModel.characteristicById(characteristicId);
      Measure measure = toMeasure(model, metricById.get(model.getMetricId()), characteristic);
      measure.setDate((Date) object[1]);
      result.add(measure);
    }
    return result;
View Full Code Here

    if (debt != null) {
      Rule rule = rules.find(ruleKey);
      if (rule != null) {
        String characteristicKey = rule.debtSubCharacteristic();
        if (characteristicKey != null) {
          Characteristic characteristic = model.characteristicByKey(characteristicKey);
          if (characteristic != null) {
            ruleDebts.add(ruleKey, debt);
            characteristicDebts.add(characteristic, debt);
            propagateTechnicalDebtInParents(characteristic.parent(), debt, characteristicDebts);
            return debt;
          }
        }
      }
    }
View Full Code Here

      }
    };
  }

  private static boolean isSameCharacteristic(Measure measure, final Characteristic characteristic) {
    Characteristic measureCharacteristic = measure.getCharacteristic();
    return measureCharacteristic != null &&
      measureCharacteristic.equals(characteristic);
  }
View Full Code Here

    measure = new Measure(CoreMetrics.NCLOC);
    measure.setData("data");
    measure.setAlertStatus(Level.ERROR);
    measure.setAlertText("alert");
    Characteristic c = mock(Characteristic.class);
    when(c.id()).thenReturn(1);
    when(techDebtModel.characteristicById(1)).thenReturn(c);
    measure.setCharacteristic(c);
    measure.setDate(new Date());
    measure.setDescription("description");
    measure.setPersistenceMode(null);
View Full Code Here

    model.setVariationValue2(measure.getVariation2());
    model.setVariationValue3(measure.getVariation3());
    model.setVariationValue4(measure.getVariation4());
    model.setVariationValue5(measure.getVariation5());
    model.setUrl(measure.getUrl());
    Characteristic characteristic = measure.getCharacteristic();
    if (characteristic != null) {
      model.setCharacteristicId(characteristic.id());
    }
    model.setPersonId(measure.getPersonId());
    model.setValue(measure.getValue());
    if (measure instanceof RuleMeasure) {
      RuleMeasure ruleMeasure = (RuleMeasure) measure;
View Full Code Here

    value.put(m.getVariation2());
    value.put(m.getVariation3());
    value.put(m.getVariation4());
    value.put(m.getVariation5());
    putUTFOrNull(value, m.getUrl());
    Characteristic characteristic = m.getCharacteristic();
    value.put(characteristic != null ? characteristic.id() : null);
    Requirement requirement = m.getRequirement();
    value.put(requirement != null ? requirement.id() : null);
    Integer personId = m.getPersonId();
    value.put(personId != null ? personId.intValue() : null);
    PersistenceMode persistenceMode = m.getPersistenceMode();
View Full Code Here

    StringBuilder sb = new StringBuilder();
    if (m.getMetricKey() != null) {
      sb.append(m.getMetricKey());
    }
    sb.append("|");
    Characteristic characteristic = m.getCharacteristic();
    if (characteristic != null) {
      sb.append(characteristic.key());
    }
    sb.append("|");
    Integer personId = m.getPersonId();
    if (personId != null) {
      sb.append(personId);
View Full Code Here

TOP

Related Classes of org.sonar.api.technicaldebt.batch.Characteristic

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.