跳至主要內容
降低代码的圈复杂度——复杂代码的解决之道

降低代码的圈复杂度——复杂代码的解决之道

本文代码示例以Go语言为例

0. 什么是圈复杂度

可能你之前没有听说过这个词,也会好奇这是个什么东西是用来干嘛的,在维基百科上有这样的解释。

Cyclomatic complexity is a software metric used to indicate the complexity of a program. It is a quantitative measure of the number of linearly independent paths through a program's source code. It was developed by Thomas J. McCabe, Sr. in 1976.


LeonSH...大约 12 分钟后端圈复杂度