Examples of debtRemediationFunction()


Examples of org.sonar.api.batch.rule.Rule.debtRemediationFunction()

    Rules rules = provider.provide(ruleDao, debtModel, durations);

    Rule rule = rules.find(RuleKey.of("checkstyle", "AvoidNull"));
    assertThat(rule.debtSubCharacteristic()).isEqualTo("EFFICIENCY");
    assertThat(rule.debtRemediationFunction()).isEqualTo(DebtRemediationFunction.createLinearWithOffset(Duration.decode("5d", 8), Duration.decode("10h", 8)));
  }

  @Test
  public void build_rules_with_overridden_debt_definitions() throws Exception {
    setupData("build_rules_with_overridden_debt_definitions");
View Full Code Here

Examples of org.sonar.api.batch.rule.Rule.debtRemediationFunction()

    Rules rules = provider.provide(ruleDao, debtModel, durations);

    Rule rule = rules.find(RuleKey.of("checkstyle", "AvoidNull"));
    assertThat(rule.debtSubCharacteristic()).isEqualTo("PORTABILITY");
    assertThat(rule.debtRemediationFunction()).isEqualTo(DebtRemediationFunction.createLinear(Duration.decode("2h", 8)));
  }

  @Test
  public void build_rules_with_default_and_overridden_debt_definitions() throws Exception {
    setupData("build_rules_with_default_and_overridden_debt_definitions");
View Full Code Here

Examples of org.sonar.api.batch.rule.Rule.debtRemediationFunction()

    Rules rules = provider.provide(ruleDao, debtModel, durations);

    // As both default columns and user columns on debt are set, user debt columns should be used
    Rule rule = rules.find(RuleKey.of("checkstyle", "AvoidNull"));
    assertThat(rule.debtSubCharacteristic()).isEqualTo("PORTABILITY");
    assertThat(rule.debtRemediationFunction()).isEqualTo(DebtRemediationFunction.createLinear(Duration.decode("2h", 8)));
  }

  @Test
  public void build_rules_with_default_characteristic_and_overridden_function() throws Exception {
    setupData("build_rules_with_default_characteristic_and_overridden_function");
View Full Code Here

Examples of org.sonar.api.batch.rule.Rule.debtRemediationFunction()

    Rules rules = provider.provide(ruleDao, debtModel, durations);

    // As both default columns and user columns on debt are set, user debt columns should be used
    Rule rule = rules.find(RuleKey.of("checkstyle", "AvoidNull"));
    assertThat(rule.debtSubCharacteristic()).isEqualTo("PORTABILITY");
    assertThat(rule.debtRemediationFunction()).isEqualTo(DebtRemediationFunction.createLinear(Duration.decode("2h", 8)));
  }

  @Test
  public void build_rules_with_overridden_characteristic_and_default_function() throws Exception {
    setupData("build_rules_with_overridden_characteristic_and_default_function");
View Full Code Here

Examples of org.sonar.api.batch.rule.Rule.debtRemediationFunction()

    Rules rules = provider.provide(ruleDao, debtModel, durations);

    // As both default columns and user columns on debt are set, user debt columns should be used
    Rule rule = rules.find(RuleKey.of("checkstyle", "AvoidNull"));
    assertThat(rule.debtSubCharacteristic()).isEqualTo("PORTABILITY");
    assertThat(rule.debtRemediationFunction()).isEqualTo(DebtRemediationFunction.createLinear(Duration.decode("2h", 8)));
  }

  @Test
  public void build_rules_with_disable_characteristic() throws Exception {
    setupData("build_rules_with_disable_characteristic");
View Full Code Here

Examples of org.sonar.api.batch.rule.Rule.debtRemediationFunction()

    Rules rules = provider.provide(ruleDao, debtModel, durations);

    Rule rule = rules.find(RuleKey.of("checkstyle", "AvoidNull"));
    assertThat(rule.debtSubCharacteristic()).isNull();
    assertThat(rule.debtRemediationFunction()).isNull();
  }

  @Test
  public void build_rules_with_default_characteristic_and_disable_characteristic() throws Exception {
    setupData("build_rules_with_default_characteristic_and_disable_characteristic");
View Full Code Here

Examples of org.sonar.api.batch.rule.Rule.debtRemediationFunction()

    Rules rules = provider.provide(ruleDao, debtModel, durations);

    Rule rule = rules.find(RuleKey.of("checkstyle", "AvoidNull"));
    assertThat(rule.debtSubCharacteristic()).isNull();
    assertThat(rule.debtRemediationFunction()).isNull();
  }

  @Test
  public void fail_if_characteristic_not_found() throws Exception {
    setupData("fail_if_characteristic_not_found");
View Full Code Here

Examples of org.sonar.api.batch.rule.Rule.debtRemediationFunction()

    assertThat(squid1.description()).isEqualTo("Detect potential bug");
    assertThat(squid1.internalKey()).isEqualTo("foo=bar");
    assertThat(squid1.status()).isEqualTo(RuleStatus.BETA);
    assertThat(squid1.severity()).isEqualTo(Severity.CRITICAL);
    assertThat(squid1.debtSubCharacteristic()).isEqualTo("COMPILER");
    assertThat(squid1.debtRemediationFunction().type()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET);
    assertThat(squid1.debtRemediationFunction().coefficient()).isEqualTo(Duration.create(10));
    assertThat(squid1.debtRemediationFunction().offset()).isEqualTo(Duration.create(60));
    assertThat(squid1.debtSubCharacteristic()).isEqualTo("COMPILER");
    assertThat(squid1.params()).hasSize(2);
    assertThat(squid1.param("min").key()).isEqualTo("min");
View Full Code Here

Examples of org.sonar.api.batch.rule.Rule.debtRemediationFunction()

    assertThat(squid1.internalKey()).isEqualTo("foo=bar");
    assertThat(squid1.status()).isEqualTo(RuleStatus.BETA);
    assertThat(squid1.severity()).isEqualTo(Severity.CRITICAL);
    assertThat(squid1.debtSubCharacteristic()).isEqualTo("COMPILER");
    assertThat(squid1.debtRemediationFunction().type()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET);
    assertThat(squid1.debtRemediationFunction().coefficient()).isEqualTo(Duration.create(10));
    assertThat(squid1.debtRemediationFunction().offset()).isEqualTo(Duration.create(60));
    assertThat(squid1.debtSubCharacteristic()).isEqualTo("COMPILER");
    assertThat(squid1.params()).hasSize(2);
    assertThat(squid1.param("min").key()).isEqualTo("min");
    assertThat(squid1.param("min").description()).isNull();
View Full Code Here

Examples of org.sonar.api.batch.rule.Rule.debtRemediationFunction()

    assertThat(squid1.status()).isEqualTo(RuleStatus.BETA);
    assertThat(squid1.severity()).isEqualTo(Severity.CRITICAL);
    assertThat(squid1.debtSubCharacteristic()).isEqualTo("COMPILER");
    assertThat(squid1.debtRemediationFunction().type()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET);
    assertThat(squid1.debtRemediationFunction().coefficient()).isEqualTo(Duration.create(10));
    assertThat(squid1.debtRemediationFunction().offset()).isEqualTo(Duration.create(60));
    assertThat(squid1.debtSubCharacteristic()).isEqualTo("COMPILER");
    assertThat(squid1.params()).hasSize(2);
    assertThat(squid1.param("min").key()).isEqualTo("min");
    assertThat(squid1.param("min").description()).isNull();
    assertThat(squid1.param("max").key()).isEqualTo("max");
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.