]> git.proxmox.com Git - ceph.git/blame - ceph/src/jaegertracing/thrift/build/docker/scripts/sca.sh
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / jaegertracing / thrift / build / docker / scripts / sca.sh
CommitLineData
f67539c2
TL
1#!/bin/bash
2set -ev
3
4#
5# Generate thrift files so the static code analysis includes an analysis
6# of the files the thrift compiler spits out. If running interactively
7# set the NOBUILD environment variable to skip the boot/config/make phase.
8#
9
10if [[ -z "$NOBUILD" ]]; then
11 ./bootstrap.sh
12 ./configure --enable-tutorial=no
13 make -j3 precross
14fi
15
16#
17# C/C++ static code analysis with cppcheck
18# add --error-exitcode=1 to --enable=all as soon as everything is fixed
19#
20# Python code style check with flake8
21#
22# search for TODO etc within source tree
23# some statistics about the code base
24# some info about the build machine
25
26# Compiler cppcheck (All)
27cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
28
29# C++ cppcheck (All)
30cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
31
32# C Glib cppcheck (All)
33cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
34
35# Silent error checks
36# See THRIFT-4371 : flex generated code triggers "possible null pointer dereference" in yy_init_buffer
37cppcheck --force --quiet --inline-suppr --suppress="*:thrift/thriftl.cc" --error-exitcode=1 -j2 compiler/cpp/src
38cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
39cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
40
41# Python code style
42flake8
43
44# PHP code style
45composer install --quiet
46./vendor/bin/phpcs
47
48# TODO etc
49echo FIXMEs: `grep -r FIXME * | wc -l`
50echo HACKs: `grep -r HACK * | wc -l`
51echo TODOs: `grep -r TODO * | wc -l`
52
53# LoC
54sloccount .
55
56# System Info
57dpkg -l
58uname -a