Skip to content

Commit 245ff8e

Browse files
Adrià Maneromikededo
authored andcommitted
fix: refactor CommitAggregation to move lines counters to PullRequestAggregation
1 parent 8036cfc commit 245ff8e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/main/java/io/pakland/mdas/githubstats/domain/entity/CommitAggregation.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ public class CommitAggregation implements CSVExportable {
66

77
private int numCommits;
88

9-
private int linesAdded;
10-
11-
private int linesRemoved;
129

1310
public static CommitAggregation aggregate(List<Commit> commits) {
1411
CommitAggregation commitAggregation = new CommitAggregation();
@@ -20,21 +17,13 @@ public int getNumCommits() {
2017
return numCommits;
2118
}
2219

23-
public int getLinesAdded() {
24-
return linesAdded;
25-
}
26-
27-
public int getLinesRemoved() {
28-
return linesRemoved;
29-
}
30-
3120
@Override
3221
public String toCSV() {
3322
String sep = ",";
3423
String lineSep = "\n";
3524

36-
List<String> metrics = List.of("numCommits", "linesAdded", "linesRemoved");
37-
List<Object> data = List.of(numCommits, linesAdded, linesRemoved);
25+
List<String> metrics = List.of("numCommits");
26+
List<Object> data = List.of(numCommits);
3827

3928
String header = String.join(sep, metrics);
4029
String body = String.join(sep, data.stream().map(Object::toString).toList());

src/main/java/io/pakland/mdas/githubstats/domain/entity/PullRequestAggregation.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
import java.util.List;
44

55
public class PullRequestAggregation implements CSVExportable {
6+
private int linesAdded;
7+
8+
private int linesRemoved;
9+
10+
public int getLinesAdded() {
11+
return linesAdded;
12+
}
13+
14+
public int getLinesRemoved() {
15+
return linesRemoved;
16+
}
617

718
public PullRequestAggregation aggregate(List<PullRequest> pullRequests) {
819
// TODO

0 commit comments

Comments
 (0)