# TScanCode is a static analyzer from Tencent
# It looks like to be based on CppCheck

git clone git@github.com:Tencent/TscanCode.git
cd TscanCode/trunk
make -j4

# It looks weird that TScanCode itself compiles with multiple warnings like 'unused-but-set-variable' and 'misleading-indentation'

# Run analysis:

./tscancode -j4 --enable=all ~/work/ClickHouse 2> result.txt

# It has no way to remove specific directories. We have to checkout ClickHouse to separate directory and manually remove "contrib".
# Otherwise it segfaults when analysing llvm submodule.

# It works quite fast:

real    0m17.174s
user    0m45.498s
sys     0m0.496s

wc -l result.txt
61 result.txt

# It gives almost all false positives.