[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)

Nov 19

Passing tests cannot detect degradation in code structure, such as surging cyclomatic complexity, bloated functions, or key logic being skipped by tests.

Unverified50%
Nov 19

A common rule-of-thumb threshold is that a single function's cyclomatic complexity should not exceed 10; exceeding it is treated as a refactoring signal.

Unverified50%
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.

Unverified60%

All Facts (12)

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

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

60%
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

It is generally considered that functions with a cyclomatic complexity exceeding 10 require close attention, and those exceeding 20 are classified as high-risk code

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

A common rule-of-thumb threshold is that a single function's cyclomatic complexity should not exceed 10; exceeding it is treated as a refactoring signal.

50%
Unverified

Passing tests cannot detect degradation in code structure, such as surging cyclomatic complexity, bloated functions, or key logic being skipped by tests.

50%
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%

Source Articles