-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Message:The Cyclomatic Complexity of this [function|method|subroutine] ["XXXXX"|expression] is Y which is greater than T authorized.
-
List of parameters:
- Key: Threshold
- Description: The maximum authorized complexity.
- Default Value: 10
- Default for ABAP: 20
- Default for RPG: 30
- Default for PHP: 20
- Default for Python: 15
-
Default Severity:Critical
-
Impact:High
-
Likelihood:Low
-
Legacy Key:too-complex-function, FunctionComplexity, SubAndFunctionComplexity, PlSql.FunctionAndProcedureComplexity, MethodCyclomaticComplexity
-
Covered Languages:ABAP, C#, C, C++, Flex, Java, JavaScript, Objective-C, PHP, PL/SQL, Python, RPG, Swift, TypeScript, VB.Net, VB6
-
Remediation Function:Linear with offset
-
Linear Argument Description:per complexity point above the threshold
-
Linear Factor:1min
-
Linear Offset:10min
-
Analysis Scope:Main Sources
-
Checkstyle:CyclomaticComplexity, NPathComplexity
-
ESLint:complexity
-
FxCop:AvoidExcessiveComplexity, CA1502
-
PMD:CyclomaticComplexity, ModifiedCyclomaticComplexity, NPathComplexity, tdCyclomaticComplexity, StdCyclomaticComplexity
-
SwiftLint:cyclomatic_complexity
-
TSLint:cyclomatic-complexity
-
TSLint-SonarTS:mccabe-complexity
The Cyclomatic Complexity of functions should not exceed a defined threshold. Complex code may perform poorly and can be difficult to test thoroughly.
- deprecates
-
RSPEC-133 Cyclomatic Complexity of methods should not be too high
- Deprecated
- is implemented by
-
SLVS-1038 Add function complexity rule to VB.NET
-
- Closed
-
-
SONARABAP-181 Rule "Functions and subroutines should not be too complex"
-
- Closed
-
-
SONARRPG-23 Rule: Subroutines should not be too complex
-
- Closed
-
-
SONARSWIFT-58 Rule: Functions should not be too complex
-
- Closed
-
-
SONARVBSIX-57 Rule : Threshold on function complexity
-
- Closed
-
-
CPP-707 Create Objective-C rules repository containing targeted rules
-
- Closed
-
- is related to
-
SONARFLEX-65 Provide linear SQALE for function complexity rule
-
- Closed
-
1.
|
VB.NET: Functions, procedures and properties should not be too complex | RSPEC-2299 |
|
Active | Unassigned | |
2.
|
PL/SQL: Functions and procedures should not be too complex | RSPEC-2412 |
|
Active | Unassigned | |
3.
|
C-Family | RSPEC-2878 |
|
Active | Unassigned | |
4.
|
C#: Methods and properties should not be too complex | RSPEC-3508 |
|
Active | Unassigned | |
5.
|
Java: Methods should not be too complex | RSPEC-3559 |
|
Active | Unassigned | |
6.
|
RPG: Subroutines should not be too complex | RSPEC-3560 |
|
Active | Unassigned | |
7.
|
VB6: Subs and functions should not be too complex | RSPEC-3561 |
|
Active | Unassigned | |
8.
|
JavaScript | RSPEC-4301 |
|
Active | Unassigned | |
9.
|
Python | RSPEC-4403 |
|
Active | Unassigned |