知识卡片
圈复杂度描述路径
圈复杂度用控制流图描述独立路径数量:无分支函数为1,新增独立判定通常增加路径数。单连通图常用E−N+2,其中E是控制流边、N是节点,不应把节点简单等同源码行数。原书代码示例存在返回类型等瑕疵,不能作为可编译样板;指标也不能区分业务本质复杂度与偶然复杂度。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 圈复杂度描述路径
原书出处 · 1 处
- Automating Architectural Governance · 查看原书依据
It is computed by applying graph theory to code, specifically decision points, which cause different execution paths. For example, if a function has no decision statements (such as if statements), then CC = 1. If the function had a single conditional, then
参考来源
- 位置:《Building Evolutionary Architectures Automated Software Governance, 2nd Edition》第04章《Automating Architectural Governance》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Building Evolutionary Architectures Automated Software Governance, 2nd Edition/_epub-src/OEBPS/ch04.html;段落定位:It is computed by applying graph theory)
- 结论依据:原文对“圈复杂度描述路径”的定义或案例,支撑“圈复杂度用控制流图描述独立路径数量:无分支函数为1,新增独立判定通常增加路径数”的归纳。据其上下文,单连通图常用E−N+2,其中E是控制流边、N是节点,不应把节点简单等同源码行数。
- 原始内容:It is computed by applying graph theory to code, specifically decision points, which cause different execution paths. For example, if a function has no decision statements (such as if statements), then CC = 1. If the function had a single conditional, then