代码度量
代码度量的说明和示例
当 Polyspace® Bug Finder™ 分析您的代码时,您可以选择计算关于您的程序的统计信息。可以使用计算代码度量 (-code-metrics)
分析选项激活代码度量检查。要了解各种代码度量结果以及 Bug Finder 如何计算它们,请参阅这些参考页。
Polyspace 结果
工程度量
文件度量
函数度量
圈复杂度 | 函数体中线性无关路径的数量 |
语言范围 | 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) 标准的一部分。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)