• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pkiraly / metadata-qa-api / #644

03 Apr 2025 09:28AM UTC coverage: 87.234% (-0.2%) from 87.454%
#644

push

pkiraly
Add mandatory and scope as generic rule properties #225

70 of 87 new or added lines in 12 files covered. (80.46%)

6 existing lines in 4 files now uncovered.

5453 of 6251 relevant lines covered (87.23%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.94
/src/main/java/de/gwdg/metadataqa/api/rule/RuleCheckerOutput.java
1
package de.gwdg.metadataqa.api.rule;
2

3
public class RuleCheckerOutput {
4
  private final RuleCheckingOutputStatus status;
5
  private RuleCheckingOutputType outputType;
6
  private Integer score = 0;
1✔
7
  private Integer instanceCount;
8
  private Integer failureCount;
9

10
  public RuleCheckerOutput(RuleChecker ruleChecker, boolean isNA, boolean passed) {
11
    this(ruleChecker, RuleCheckingOutputStatus.create(isNA, passed, ruleChecker.isMandatory()));
1✔
12
  }
1✔
13

14
  public RuleCheckerOutput(RuleChecker ruleChecker, RuleCheckingOutputStatus status) {
1✔
15
    this.status = status;
1✔
16
    if (status.equals(RuleCheckingOutputStatus.FAILED))
1✔
17
      score = ruleChecker.getFailureScore();
1✔
18
    else if (status.equals(RuleCheckingOutputStatus.PASSED))
1✔
19
      score = ruleChecker.getSuccessScore();
1✔
20
    else if (status.equals(RuleCheckingOutputStatus.NA))
1✔
21
      score = ruleChecker.getNaScore();
1✔
22
  }
1✔
23

24
  public RuleCheckerOutput(RuleCheckingOutputStatus status, Integer score) {
1✔
25
    this.status = status;
1✔
26
    this.score = score;
1✔
27
  }
1✔
28

29
  public RuleCheckingOutputStatus getStatus() {
30
    return status;
1✔
31
  }
32

33
  public Integer getScore() {
34
    return score;
1✔
35
  }
36

37
  public Integer getInstanceCount() {
UNCOV
38
    return instanceCount;
×
39
  }
40

41
  public RuleCheckerOutput setInstanceCount(Integer instanceCount) {
42
    this.instanceCount = instanceCount;
1✔
43
    return this;
1✔
44
  }
45

46
  public Integer getFailureCount() {
UNCOV
47
    return failureCount;
×
48
  }
49

50
  public RuleCheckerOutput setFailureCount(Integer failureCount) {
51
    this.failureCount = failureCount;
1✔
52
    return this;
1✔
53
  }
54

55
  public String toString() {
56
    return outputType != null && outputType.equals(RuleCheckingOutputType.STATUS)
1✔
57
      ? status.asString()
1✔
58
      : score == null
1✔
59
        ? "0" : score.toString();
1✔
60
  }
61

62
  @Override
63
  protected Object clone() throws CloneNotSupportedException {
64
    return new RuleCheckerOutput(status, score)
1✔
65
      .setInstanceCount(instanceCount)
1✔
66
      .setFailureCount(failureCount);
1✔
67
  }
68

69
  public RuleCheckerOutput setOutputType(RuleCheckingOutputType outputType) {
70
    this.outputType = outputType;
1✔
71
    return this;
1✔
72
  }
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc