Softwaretechnik-II/boa/mining/aufgabe_01_b.boa
Jan-Niclas Loosen ce17502029 add llm chapter
2025-01-30 11:12:08 +01:00

34 lines
903 B
Plaintext

# Java-Job: Throws empty error on the "2022 Jan/Java" dataset.
# Python-Job: 111838
# Includes all revisions
p: Project = input;
# Prepare output variables
relative_list: output mean[string][int] of float;
# Temporary variables
cur_date: time;
statement_counter := visitor {
before node: Statement -> {
if (node.kind == StatementKind.TRY or node.kind == StatementKind.WITH)
relative_list[p.name][yearof(cur_date)] << 1;
else
relative_list[p.name][yearof(cur_date)] << 0;
}
};
visit(p, visitor {
before node: CodeRepository -> {
for (minus_year: int=19; minus_year >= 0; minus_year--) {
cur_date = addyear(T"Dec 31, 2019, 10:00:00 AM", -minus_year);
snapshot := getsnapshot(node, cur_date);
foreach (i: int; def(snapshot[i]))
visit(snapshot[i], statement_counter);
}
}
});