[KongchangAI]
ConceptCyclomatic Complexity

Cyclomatic Complexity

A code complexity metric introduced by Thomas McCabe in 1976. It measures the number of independent execution paths through a program, and it is generally recommended that a single function not exceed a cyclomatic complexity of 10.

Core Facts

Timeline (last 90 days)

Oct 13

Cyclomatic complexity only counts control flow branches and is completely insensitive to data coupling, naming quality, and whether the level of abstraction is appropriate.

Unverified50%
Sep 25

Cyclomatic Complexity, proposed by Thomas McCabe in 1976, quantifies code complexity by counting the number of independent execution paths in the code.

Unverified50%
Sep 25

Software engineering generally recommends that the cyclomatic complexity of a single function not exceed 10.

Unverified50%
Sep 12

Commonly used metrics for code quality assessment include cyclomatic complexity, code duplication rate, unit test coverage, and whether SOLID principles are followed.

Unverified50%

All Facts (10)

Verified

Cyclomatic Complexity was proposed by Thomas McCabe in 1976 to measure the complexity of a program's control flow.

80%
Verified

Cyclomatic complexity was proposed by Thomas McCabe in 1976, calculated as M = E - N + 2P, and the industry typically sets the upper limit of cyclomatic complexity for a single module at 10–15.

65%
Verified

The industry generally considers that a cyclomatic complexity exceeding 10 for a single function requires refactoring

65%
Unverified

通常认为圈复杂度超过10的函数需要重点关注,超过20则属于高风险代码

85%
Unverified

When AI models generate code, they lack persistent memory of the overall architecture and tend toward local patching rather than global refactoring in each iteration, causing cyclomatic complexity and coupling to continuously rise.

60%
Unverified

In the industry, a cyclomatic complexity of 10 is generally considered a warning threshold, and exceeding 20 is considered to make code difficult to maintain and test.

60%
Unverified

Cyclomatic complexity only counts control flow branches and is completely insensitive to data coupling, naming quality, and whether the level of abstraction is appropriate.

50%
Unverified

Cyclomatic Complexity, proposed by Thomas McCabe in 1976, quantifies code complexity by counting the number of independent execution paths in the code.

50%
Unverified

Software engineering generally recommends that the cyclomatic complexity of a single function not exceed 10.

50%
Unverified

Commonly used metrics for code quality assessment include cyclomatic complexity, code duplication rate, unit test coverage, and whether SOLID principles are followed.

50%

Source Articles