是否有 Cppcheck 消息列表?

Is there a list of Cppcheck messages?

我们的团队以前使用 Lint 作为静态代码分析器,但它变得太杂乱且噪音太大。

我们正在使用 C++03 并经常使用 Boost, and Lint didn't seem to like Boost (I hear this has become better in later versions). I started looking at other static code analysers and came across Cppcheck 并进行了试用。它的警告给我留下了深刻的印象(我已经看到了十几个信息和样式问题)。

我感兴趣的是:是否有一个Cppcheck发出的所有Cppcheck消息的列表,类似于how Lint and PVS-Studio both have a list of their messages? The official Cppcheck website列表:

但我对类似于 Lint 和 PVS-Studio 的东西更感兴趣,并且类似于 Visual Studio:

中结果的显示方式
ID | Category/Severity | Text

Cppcheck 检查列表可用 at the project's wiki,如此处所述,您还可以通过 运行:

从命令行获取列表
$ cppcheck --doc

$ cppcheck --errorlist

错误列表输出一个 XML 文件,其中包含您想要的所有三样东西。这是其中的一个小例子:

<error id="unnecessaryForwardDeclaration" severity="style" msg="The variable &apos;name&apos; forward declaration is unnecessary. Type variable is already declared earlier."/>
<error id="variableHidingEnum" severity="style" msg="variable &apos;name&apos; hides enumerator with same name"/>
<error id="unnecessaryQualification" severity="style" msg="The extra qualification &apos;type&apos; is unnecessary and is considered an error by many compilers."/>