Examples of key()


Examples of org.sonar.api.server.debt.internal.DefaultDebtCharacteristic.key()

      } else if (StringUtils.equals(node, CHARACTERISTIC_NAME)) {
        characteristic.setName(cursor.collectDescendantText().trim());

        // <chc> can contain characteristics or requirements
      } else if (StringUtils.equals(node, CHARACTERISTIC)) {
        process(debtModel, characteristic.key(), cursor);
      }
    }
  }

  static String convertKey(String key){
View Full Code Here

Examples of org.sonar.api.task.TaskDefinition.key()

    for (TaskDefinition def : definitions()) {
      TaskDefinition other = byClass.get(def.taskClass());
      if (other == null) {
        byClass.put(def.taskClass(), def);
      } else {
        throw new SonarException("Task '" + def.taskClass().getName() + "' is defined twice: first by '" + other.key() + "' and then by '" + def.key() + "'");
      }
    }
  }
}
View Full Code Here

Examples of org.sonar.api.technicaldebt.batch.Characteristic.key()

      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

Examples of org.sonar.api.technicaldebt.batch.internal.DefaultCharacteristic.key()

  public void get_characteristics() throws Exception {
    assertThat(sqaleModel.rootCharacteristics()).hasSize(1);

    DefaultCharacteristic resultRootCharacteristic = sqaleModel.rootCharacteristics().get(0);
    assertThat(resultRootCharacteristic.id()).isEqualTo(1);
    assertThat(resultRootCharacteristic.key()).isEqualTo("MEMORY_EFFICIENCY");
    assertThat(resultRootCharacteristic.name()).isEqualTo("Memory use");
    assertThat(resultRootCharacteristic.order()).isEqualTo(1);
    assertThat(resultRootCharacteristic.children()).hasSize(1);
    assertThat(resultRootCharacteristic.parent()).isNull();
    assertThat(resultRootCharacteristic.root()).isNull();
View Full Code Here

Examples of org.sonar.check.Rule.key()

  private String getRuleKey(Object annotatedClassOrObject) {
    String key = null;
    Rule ruleAnnotation = AnnotationUtils.getAnnotation(annotatedClassOrObject, Rule.class);
    if (ruleAnnotation != null) {
      key = ruleAnnotation.key();
    }
    Class clazz = annotatedClassOrObject.getClass();
    if (annotatedClassOrObject instanceof Class) {
      clazz = (Class) annotatedClassOrObject;
    }
View Full Code Here

Examples of org.sonar.check.RuleProperty.key()

  private Field getField(Object check, String key) {
    List<Field> fields = FieldUtils2.getFields(check.getClass(), true);
    for (Field field : fields) {
      RuleProperty propertyAnnotation = field.getAnnotation(RuleProperty.class);
      if (propertyAnnotation != null && (StringUtils.equals(key, field.getName()) || StringUtils.equals(key, propertyAnnotation.key()))) {
        return field;
      }
    }
    return null;
  }
View Full Code Here

Examples of org.sonar.core.component.ComponentDto.key()

      List<Period> periodList = periods(component.projectUuid(), session);
      Integer periodIndex = request.paramAsInt(PARAM_PERIOD);
      Date periodDate = periodDate(periodIndex, periodList);

      RulesAggregation rulesAggregation = issueService.findRulesByComponent(component.key(), periodDate, session);
      Multiset<String> severitiesAggregation = issueService.findSeveritiesByComponent(component.key(), periodDate, session);
      Map<String, MeasureDto> measuresByMetricKey = measuresByMetricKey(component, session);

      appendComponent(json, component, userSession, session);
      appendPermissions(json, component, userSession);
View Full Code Here

Examples of org.sonar.server.qualityprofile.ActiveRule.key()

      QualityProfileDto.createFor("abcd").setName("Default").setLanguage("java").setRulesUpdatedAt("2014-01-14T14:00:00+0200")
      );

    RuleKey ruleKey = RuleKey.of("squid", "AvoidCycle");
    ActiveRule activeRule = mock(ActiveRule.class);
    when(activeRule.key()).thenReturn(ActiveRuleKey.of("abcd", ruleKey));
    when(activeRule.severity()).thenReturn(Severity.MINOR);
    when(activeRule.params()).thenReturn(ImmutableMap.of("max", "2"));
    when(qProfileLoader.findActiveRulesByProfile("abcd")).thenReturn(newArrayList(activeRule));

    Rule rule = mock(Rule.class);
View Full Code Here

Examples of org.sonar.server.rule.Rule.key()

    dbSession.commit();

    Rule rule = index.getByKey(RuleKey.of("javascript", "S001"));

    assertThat(rule.htmlDescription()).isEqualTo(ruleDto.getDescription());
    assertThat(rule.key()).isEqualTo(ruleDto.getKey());

    assertThat(rule.debtRemediationFunction().type().name())
      .isEqualTo(ruleDto.getRemediationFunction());

    assertThat(Sets.newHashSet(rule.tags())).isEqualTo(ruleDto.getTags());
View Full Code Here

Examples of org.sonar.wsclient.component.Component.key()

    Issues issues = new IssueJsonParser().parseIssues(json);

    assertThat(issues.components()).hasSize(1);

    Component component = issues.component(issues.list().get(0));
    assertThat(component.key()).isEqualTo("struts:Action.java");
    assertThat(component.id()).isEqualTo(10L);
    assertThat(component.qualifier()).isEqualTo("CLA");
    assertThat(component.name()).isEqualTo("Action");
    assertThat(component.longName()).isEqualTo("org.struts.Action");
    assertThat(component.subProjectId()).isEqualTo(2L);
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.