-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
b544c58
commit ce4d280
Showing
15 changed files
with
738 additions
and
34 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
web/server/vue-cli/src/components/AnalysisInfo/Checker.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
115
web/server/vue-cli/src/components/AnalysisInfo/CheckerGroup.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
32
web/server/vue-cli/src/components/AnalysisInfo/CheckerRows.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; |
Oops, something went wrong.