编码标准和代码度量
将您的工作流迁移到 Bug Finder。使用 Bug Finder 检查编码规则、指定自定义规则并生成代码复杂度度量
使用 Polyspace®Code Prover™ 计算代码的堆栈使用量度量。要检查编码违规并计算代码复杂度度量,请使用 Polyspace Bug Finder™
注意
Code Prover 不再支持检查您的代码是否符合外部编码标准和计算代码度量。请将这些工作流迁移到 Bug Finder。请参阅Migrate Code Prover Workflows for Checking Coding Standards and Code Metrics to Bug Finder。
Polyspace 选项
主题
迁移到 Bug Finder
- Migrate Code Prover Workflows for Checking Coding Standards and Code Metrics to Bug Finder
Use Bug Finder instead of Code Prover to check compliance with various coding standards, naming conventions, and code complexity standards. Calculate code metrics by using Bug Finder. - 编码标准和代码度量
MISRA、AUTOSAR、CERT 和 JSF 编码规则集,自定义编码规则,代码度量
快速入门
- 指定 Polyspace 分析选项
在 Polyspace 用户界面、其他 IDE 或脚本中指定 Polyspace 分析选项。 - 检查并审查编码标准违规
使用 Polyspace Bug Finder 检查代码是否违反了 AUTOSAR C++14、CERT® C、CERT C++、CWE、MISRA C™、MISRA® C++、JSF AV C++ 或 ISO-17961 标准。 - Enforce Naming Conventions for C/C++ Variables and Functions
Enforce naming conventions and other style guidelines on C/C++ code with Polyspace.
MISRA 或 JSF 规则
- Avoid Violations of MISRA C Rules 8.x
Avoid conflicting declarations or unintended modification of variables. - Coding Rule Subsets Checked Early in Analysis
Adjust your coding rules checking for a faster analysis.
代码复杂度度量
- 使用 Polyspace 计算代码复杂度度量
对代码复杂度度量(例如圈复杂度和嵌套深度)强制施加限制。 - HIS 代码复杂度度量
查看 Polyspace 中支持的哪些代码复杂度度量是 Hersteller Initiative Software (HIS) 标准的一部分。