forked from Ericsson/codechecker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckerStatistics.vue
More file actions
99 lines (86 loc) · 2.57 KB
/
Copy pathCheckerStatistics.vue
File metadata and controls
99 lines (86 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<template>
<v-container fluid>
<v-col>
<v-row class="ma-0 mb-4">
<h3
class="text-h5 text-primary"
>
<v-btn
color="primary"
variant="outlined"
@click="downloadCSV"
>
Export CSV
</v-btn>
<v-btn
icon="mdi-refresh"
title="Reload statistics"
color="primary"
variant="text"
@click="fetchStatistics"
/>
</h3>
</v-row>
<v-row class="ma-0">
<checker-statistics-table
:items="baseStats.statistics.value"
:loading="loading"
/>
<unique-stat-warning
v-if="baseStats.reportFilter.value.isUnique"
/>
</v-row>
</v-col>
</v-container>
</template>
<script setup>
import { ref } from "vue";
import { UniqueStatWarning } from "@/components/Statistics";
import {
getCheckerStatistics
} from "@/components/Statistics/StatisticsHelper";
import { useBaseStatistics } from "@/composables/useBaseStatistics";
import { useSeverity } from "@/composables/useSeverity";
import { useToCSV } from "@/composables/useToCSV";
import CheckerStatisticsTable from "./CheckerStatisticsTable";
const props = defineProps({
bus: { type: Object, required: true },
namespace: { type: String, required: true }
});
const severity = useSeverity();
const csv = useToCSV();
const baseStats = useBaseStatistics(props, getCheckerStatistics);
const loading = ref(false);
baseStats.setupRefreshListener(fetchStatistics);
function downloadCSV() {
const _data = [
[
"Checker", "Severity", "Unreviewed",
"Confirmed bug", "Outstanding reports (Unreviewed + Confirmed)",
"False positive", "Intentional",
"Suppressed reports (False positive + Intentional)", "All reports"
],
...baseStats.statistics.value.map(_stat => {
return [
_stat.checker, severity.severityFromCodeToString(_stat.severity),
_stat.unreviewed.count, _stat.confirmed.count,
_stat.outstanding.count, _stat.falsePositive.count,
_stat.intentional.count, _stat.suppressed.count, _stat.reports.count,
];
})
];
csv.toCSV(_data, "codechecker_checker_statistics.csv");
}
async function fetchStatistics() {
loading.value = true;
const {
runIds: _runIds,
reportFilter: _reportFilter,
cmpData: _cmpData
} = baseStats.getStatisticsFilters();
baseStats.statistics.value =
await getCheckerStatistics(_runIds, _reportFilter, _cmpData);
await baseStats.fetchDifference("checker");
loading.value = false;
}
</script>