Main Content

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

代码度量

代码度量的说明和示例

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

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
估计的函数耦合Measure of complexity between levels of call tree
行数文件中的总行数
无注释行数不包括注释行和空行的代码行数
圈复杂度函数体中线性无关路径的数量
语言范围Cost of maintaining or changing 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) 标准的一部分。