Skip to content

Commit

Permalink
feat(gui): Checker status auditing
Browse files Browse the repository at this point in the history
Extend the "Analysis Info" dialog on the Web UI to be capable of
rendering the new `AnalysisInfo.checkers` data structure from the API.

If the data is available, renders an expanding widget first grouped by
analyser, then heuristically by checker "group". If the group is not
entirely enabled or disabled, shows the number of enabled, disabled, and
total checkers. Does the same for the analyser as a whole.

If the data is not available, it tries doing its best to give the user a
reason why. Likely it is because of two things: runs upgraded from older
server versions that did not collect the data, or runs done not with
`CodeChecker analyze`.
  • Loading branch information
whisperity committed Mar 2, 2024
1 parent b544c58 commit ce4d280
Show file tree
Hide file tree
Showing 15 changed files with 738 additions and 34 deletions.
5 changes: 2 additions & 3 deletions web/server/vue-cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/server/vue-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"jsplumb": "^2.15.6",
"lodash": "^4.17.21",
"marked": "^4.0.10",
"semver": "^5.7.1",
"splitpanes": "^2.3.8",
"vue": "^2.6.14",
"vue-chartjs": "^3.5.1",
Expand Down
54 changes: 54 additions & 0 deletions web/server/vue-cli/src/components/AnalysisInfo/Checker.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<template>
<v-row
no-gutters
align="center"
>
<v-col
cols="auto"
>
<analyzer-statistics-icon
class="mr-2"
:value="(enabled ? 'successful' : 'failed')"
:title="'\'' + name + '\' ' + (enabled ? 'was' : 'was not') +
' enabled in this analysis.'"
/>
</v-col>
<v-col
:class="'pr-1 checker-name ' +
(enabled ? 'checker-enabled' : 'checker-disabled')"
>
{{ name }}
</v-col>
</v-row>
</template>

<script>
import { AnalyzerStatisticsIcon } from "@/components/Icons";
export default {
name: "Checker",
components: {
AnalyzerStatisticsIcon
},
props: {
enabled: { type: Boolean, required: true },
name: { type: String, required: true }
}
};
</script>
<style lang="scss" scoped>
.analysis-info {
.checker-name {
font-family: monospace;
font-weight: normal;
}
.checker-name.checker-enabled {
color: black;
}
.checker-name.checker-disabled {
color: black;
}
}
</style>
115 changes: 115 additions & 0 deletions web/server/vue-cli/src/components/AnalysisInfo/CheckerGroup.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<template>
<v-expansion-panel>
<v-expansion-panel-header
class="pa-0 px-1"
>
<v-row
no-gutters
align="center"
>
<v-col cols="auto">
<v-chip
class="mr-1 pa-1"
:color="groupWideStatus"
:ripple="false"
:title="'Group \'' + group + '\' was' +
(needDetailedCounts ? ' partially' :
(groupEnabled ? '' : ' not')
) +
' enabled in this analysis'"
outlined
dark
small
>
<v-icon
v-if="!needDetailedCounts && groupEnabled"
start
>
mdi-check
</v-icon>
<v-icon
v-else-if="!needDetailedCounts && !groupEnabled"
start
>
mdi-close
</v-icon>
<v-icon
v-else-if="needDetailedCounts"
start
>
mdi-tune
</v-icon>
</v-chip>
</v-col>
<v-col
cols="auto"
class="pl-2 checker-group-name primary--text"
>
{{ group }}
</v-col>
<v-col cols="auto">
<count-chips
v-if="needDetailedCounts"
:num-good="counts[0]"
:num-bad="counts[1]"
:num-total="counts[2]"
:good-text="'Number of checkers enabled (executed)'"
:bad-text="'Number of checkers disabled (not executed)'"
:total-text="'Number of checkers available'"
:simplify-showing-if-all="true"
:show-total="true"
:show-dividers="false"
:show-zero-chips="false"
class="pl-4"
/>
</v-col>
</v-row>
</v-expansion-panel-header>
<v-expansion-panel-content>
<checker-rows
:checkers="checkers"
/>
</v-expansion-panel-content>
</v-expansion-panel>
</template>

<script>
import CountChips from "@/components/CountChips";
import CheckerRows from "./CheckerRows";
export default {
name: "CheckerGroup",
components: {
CheckerRows,
CountChips,
},
props: {
group: { type: String, required: true },
checkers: { type: Array, required: true },
counts: { type: Array, required: true }
},
computed: {
needDetailedCounts() {
return this.counts[0] > 0 && this.counts[1] > 0;
},
groupWideStatus() {
if (this.counts[0] > 0 && this.counts[1] === 0)
return "success";
if (this.counts[0] === 0 && this.counts[1] > 0)
return "error";
return "grey darken-1";
},
groupEnabled() {
return this.groupWideStatus === "success";
}
}
};
</script>
<style lang="scss" scoped>
.analysis-info .checker-group-name {
font-family: monospace;
font-size: 112.5%;
font-style: italic;
font-weight: medium;
}
</style>
32 changes: 32 additions & 0 deletions web/server/vue-cli/src/components/AnalysisInfo/CheckerRows.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<template>
<v-container
class="analysis-info-checker-rows-in-columns"
>
<checker
v-for="(checker, idx) in checkers"
:key="idx"
:name="checker[0]"
:enabled="checker[1]"
/>
</v-container>
</template>

<script>
import Checker from "./Checker";
export default {
name: "CheckerRows",
components: {
Checker
},
props: {
checkers: { type: Array, required: true }
}
};
</script>

<style lang="scss" scoped>
.analysis-info .analysis-info-checker-rows-in-columns {
columns: 32em auto;
}
</style>
9 changes: 9 additions & 0 deletions web/server/vue-cli/src/components/AnalysisInfo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Checker from "./Checker";
import CheckerGroup from "./CheckerGroup";
import CheckerRows from "./CheckerRows";

export {
Checker,
CheckerGroup,
CheckerRows
};
Loading

0 comments on commit ce4d280

Please sign in to comment.