The complexity is measured by the number of
if,
while,
do,
for,
?:,
catch,
switch,
case statements, and operators
&& and
|| (plus one) in the body of a constructor, method, static initializer, or instance initializer. It is a measure of the minimum number of possible paths through the source and therefore the number of required tests. Generally 1-4 is considered good, 5-7 ok, 8-10 consider re-factoring, and 11+ re-factor now!
complexity 是指 if, while, do, for, ?:, catch, switch, case && and || 在构造函数,方法,静态初始化,实例初始化?中的数量。他用来衡量执行代码经过的最少路径以及由此需要的测试数。
通常1-4表明非常好,5-7表明可以,8-10表明需要重构,11以上表明马上重构
complexity 是指 if, while, do, for, ?:, catch, switch, case && and || 在构造函数,方法,静态初始化,实例初始化?中的数量。他用来衡量执行代码经过的最少路径以及由此需要的测试数。
通常1-4表明非常好,5-7表明可以,8-10表明需要重构,11以上表明马上重构