java复杂性,java – Cyclomatic复杂性和变体

本文解释了设计复杂度、圈复杂度及扩展圈复杂度的概念及其计算方式,这三种度量分别用于评估方法间的依赖性、路径数及控制逻辑的复杂度。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

什么是必要的,设计复杂性,扩展的圈复杂度,圈复杂度之间的差异?

我正在使用IntelliJ IDEA插件检查这些指标.

解决方法:

概观

设计复杂度衡量方法对其他方法的依赖性;圈复杂度通过一种方法测量不同路径的数量;并且扩展的圈复杂度增加了一个控制逻辑度量来表示“完全运用方法控制流所需的最小数量的测试”.

细节

This metric reports the design complexity of a method. The design

complexity is related to how interlinked a method’s control flow is

with calls to other methods. Design complexity ranges from 1 to V(g),

the cyclomatic complexity of the method. Design complexity also

represents the minimal number of tests necessary to exercise the

integration of the method with the methods it calls.

This metric reports the cyclomatic complexity of each non-abstract

method. Cyclomatic complexity is a graph-theoretic measure of the

number of distinct paths through each method. In practice, it is

basically 1 + the number of branch points in the method.

This metric reports the extended cyclomatic complexity of each

non-abstract method. Cyclomatic complexity is a graph-theoretic

measure of the number of distinct paths through each method, augmented

by a measure of the complexity of the decision points. In practice, it

is basically 1 + the number of branch points in the method plus the

number of logical ‘and’ and ‘or’ operations. Cyclomatic complexity

also represents the minimal number of tests necessary to completely

exercise a method’s control flow.

标签:java,complexity-theory

来源: https://codeday.me/bug/20190609/1206236.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值