一、风格检测cpplint
简介: https://blog.youkuaiyun.com/yelu_hong/article/details/83856306
cpplint 源码 https://github.com/google/styleguide/blob/gh-pages/cpplint/cpplint.py
简单使用 python cpplint.py test.cpp
谷歌c++规范地址: https://zh-google-styleguide.readthedocs.io/en/latest/google-cpp-styleguide/headers/
添加c语言支持: 修改cpplint.py
_valid_extensions = set(['cc', 'h', 'cpp', 'cu', 'cuh', 'c'])
二、静态检测
资料:https://blog.youkuaiyun.com/qq_34595352/article/details/103194789
TscanCode地址:https://github.com/Tencent/TscanCode
linux编译: 到trank目录执行make
简单使用: 拷贝cfg目录到检测源码目录,执行tscancode --xml ./
三、golang静态检测工具
golangci-lint:
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
golangci-lint run ./... //当前目录下所有文件
GoMetalinter :
go get -u github.com/alecthomas/gometalinter
gometalinter --install --update
gometalinter ./...
goreporter:
四、 函数关系生成
git clone https://github.com/AaronNGray/cflow.git
cflow -T -m main -n *.c > main.txt
wget -c https://github.com/tinyclub/linux-0.11-lab/raw/master/tools/tree2dotx
cp tree2dotx /usr/sbin/
cat main.txt | tree2dotx > main.dot
yum install graphviz-gd
dot -Tgif main.dot -o main.gif
dot -Tpng main.dot -o main.png
五、其他
c++test