continue homework
This commit is contained in:
25
boa/mining/aufgabe_01_a.boa
Normal file
25
boa/mining/aufgabe_01_a.boa
Normal file
@@ -0,0 +1,25 @@
|
||||
# Java-Job: 111005
|
||||
# Python-Job: 111006
|
||||
|
||||
# Includes all revisions
|
||||
p: Project = input;
|
||||
|
||||
# Prepare output variables
|
||||
relative_list: output mean[string] of float;
|
||||
|
||||
statement_counter := visitor {
|
||||
before node: Statement -> {
|
||||
if(node.kind == StatementKind.TRY or node.kind == StatementKind.WITH)
|
||||
relative_list[p.name] << 1;
|
||||
else
|
||||
relative_list[p.name] << 0;
|
||||
}
|
||||
};
|
||||
|
||||
visit(p, visitor {
|
||||
before node: CodeRepository -> {
|
||||
snapshot := getsnapshot(node);
|
||||
foreach (i: int; def(snapshot[i]))
|
||||
visit(snapshot[i], statement_counter);
|
||||
}
|
||||
});
|
33
boa/mining/aufgabe_01_b.boa
Normal file
33
boa/mining/aufgabe_01_b.boa
Normal file
@@ -0,0 +1,33 @@
|
||||
# Java-Job: 111694
|
||||
# Python-Job: 111439
|
||||
|
||||
# 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 (def(node.kind) and (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=22; minus_year >= 0; minus_year--) {
|
||||
cur_date = addyear(T"Dec 31, 2022, 10:00:00 AM", -minus_year);
|
||||
snapshot := getsnapshot(node, cur_date);
|
||||
|
||||
foreach (i: int; def(snapshot[i]))
|
||||
visit(snapshot[i], statement_counter);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
91155
boa/mining/boa-job111005-output.txt
Normal file
91155
boa/mining/boa-job111005-output.txt
Normal file
File diff suppressed because it is too large
Load Diff
102408
boa/mining/boa-job111006-output.txt
Normal file
102408
boa/mining/boa-job111006-output.txt
Normal file
File diff suppressed because it is too large
Load Diff
652905
boa/mining/boa-job111439-output.txt
Normal file
652905
boa/mining/boa-job111439-output.txt
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user