主要内容

本页翻译不是最新的。点击此处可查看最新英文版本。

代码度量

代码度量的描述和示例

Polyspace® Bug Finder™ 分析您的代码时,您可以选择计算关于您的程序的统计信息。可以使用计算代码度量 (-code-metrics) 分析选项激活代码度量检查。要了解各种代码度量结果以及 Bug Finder 如何计算它们,请参阅这些参考页。

Polyspace Bug Finder 不支持计算堆栈使用度量。要计算堆栈使用度量,请使用 Polyspace Code Prover™。请参阅计算堆栈使用情况 (-stack-usage) (Polyspace Code Prover)

Polyspace 结果

全部展开

直接递归次数函数直接调用自身的实例数
头文件数量Number of included header files
文件数源文件的数量
递归次数Number of call graph cycles over one or more functions
注释密度Ratio of number of comments to number of statements
注释比率Ratio of number of lines that contain comments to the total number of lines in a file, expressed as percentage
估计的函数耦合Measure of complexity between levels of call tree
行数文件中的总行数
无注释行数不包括空行和仅有注释的行的代码行数
圈复杂度函数体中线性无关路径的数量
函数注释密度Ratio of number of comments to number of statements in function
函数压力复杂度Complexity of internal structure and external connections of a function
语言范围维护或更改函数的成本
调用层数控制流语句的嵌套深度
调用次数Number of calls in function body
被调函数数量Number of distinct functions called within the body of a function
主调函数数量Number of distinct callers of a function
可执行代码行数Number of executable lines in function body
函数参数数量函数参量数量
Goto 语句数goto 语句数目
指令数每个函数的指令数目
正文行数Number of lines in function body
局部非静态变量数函数中的局部变量总数
局部静态变量数函数中的局部静态变量总数
路径数Estimated static path count
Return 语句数函数中的 return 语句数目

主题

  • HIS 代码复杂度度量

    查看 Polyspace 中支持的哪些代码复杂度度量是 Hersteller Initiative Software (HIS) 标准的一部分。