forked from bbvadata/Jazz
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstatic_analysis.sh
executable file
·46 lines (34 loc) · 1.25 KB
/
static_analysis.sh
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
#!/bin/bash
# (c) 2018-2024 kaalam.ai (The Authors of Jazz)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
pushd server || exit 1
make clean
if ! scan-build -o ./static_analysis_reports/ make jazz
then
echo "make failed."
exit 1
fi
if ! scan-build -o ./static_analysis_reports/ make tjazz
then
echo "make failed."
exit 1
fi
cppcheck src/ -i src/catch2/ -i src/curl/ --enable=all --inconclusive --library=posix --suppress=missingInclude --inline-suppr --force --xml 2>report.xml
cppcheck-htmlreport --file=report.xml --title="Jazz (inconclusive)" --report-dir=static_analysis_reports/inconclusive --source-dir=.
rm -f report.xml
cppcheck src/ -i src/catch2/ -i src/curl/ --force --inline-suppr --xml 2>report.xml
cppcheck-htmlreport --file=report.xml --title="Jazz (mandatory)" --report-dir=static_analysis_reports/mandatory --source-dir=.
rm -f report.xml
popd || exit 1
reports=$(find server/static_analysis_reports/ | grep "index.html")
printf "\nDone.\n"
printf "\n** See the reports in: **"
printf "\n---===================---\n\n"
echo "$reports"
printf "\n"