Main Content

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

编码标准和代码指标

MISRA、AUTOSAR、CERT 和 JSF 编码规则集,自定义编码规则,代码指标

要指定您要检查的编码标准,例如 MISRA C®:2012 或 AUTOSAR C++14,请使用编码标准选项。要在分析结果中查看代码复杂度指标,例如圈复杂度和调用函数或被调用函数的数目,请使用代码指标选项。

分析选项

全部展开

检查 MISRA C:2004 (-misra2)Check for violation of MISRA C:2004 rules
检查 MISRA AC AGC (-misra-ac-agc)Check for violation of MISRA AC AGC rules
检查 MISRA C:2012 (-misra3)Check for violations of MISRA C:2012 rules and directives
使用生成的代码需求 (-misra3-agc-mode)Check for violations of MISRA C:2012 rules and directives that apply to generated code
有效的布尔类型 (-boolean-types)Specify data types that coding rule checker must treat as effectively Boolean
检查 SEI CERT-C (-cert-c)Check for violations of CERT C rules and recommendations
检查 ISO/IEC TS 17961 (-iso-17961)Check for violations of ISO/IEC TS 17961 rules
检查 MISRA C++:2008 (-misra-cpp)Check for violations of MISRA C++ rules
检查 JSF AV C++ (-jsf-coding-rules)Check for violations of JSF C++ rules
检查 AUTOSAR C++14 (-autosar-cpp14)Check for violations of AUTOSAR C++ 14 rules
检查 SEI CERT-C++ (-cert-cpp)Check for violations of CERT C++ rules
按文件设置检查项 (-checkers-selection-file)Define a custom set of coding standards checks for your analysis
检查自定义规则 (-custom-rules)Follow naming conventions for identifiers
检查规范 (-guidelines)Check for violations of Guidelines
允许的 pragma (-allowed-pragmas)Specify pragma directives that are documented
计算代码指标 (-code-metrics)Compute and display code complexity metrics

主题

快速入门

MISRA 或 JSF 规则

代码复杂度指标