aws-amplify / amplify-codegen
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 873 units with 15,628 lines of code in units (48.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (271 lines of code)
    • 35 medium complex units (1,734 lines of code)
    • 85 simple units (2,732 lines of code)
    • 751 very simple units (10,891 lines of code)
0% | 1% | 11% | 17% | 69%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
ts0% | 1% | 10% | 15% | 73%
js0% | 5% | 15% | 29% | 50%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/appsync-modelgen-plugin/src0% | 4% | 20% | 27% | 47%
packages/amplify-codegen/src0% | 8% | 21% | 30% | 40%
packages/graphql-types-generator/src0% | 0% | 15% | 29% | 55%
packages/amplify-codegen-e2e-core/src0% | 0% | 4% | 5% | 90%
packages/graphql-docs-generator/src0% | 0% | 9% | 14% | 76%
scripts0% | 0% | 0% | 61% | 38%
packages/graphql-types-generator/fixtures0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
protected generateSerializationMethod()
in packages/appsync-modelgen-plugin/src/visitors/appsync-dart-visitor.ts
152 45 2
async function add()
in packages/amplify-codegen/src/commands/add.js
119 35 2
export function getConnectedFieldV2()
in packages/appsync-modelgen-plugin/src/utils/process-connections-v2.ts
99 22 5
export function processConnections()
in packages/appsync-modelgen-plugin/src/utils/process-connections.ts
82 22 3
async function addWalkThrough()
in packages/amplify-codegen/src/walkthrough/add.js
64 19 5
protected generateToStringMethod()
in packages/appsync-modelgen-plugin/src/visitors/appsync-dart-visitor.ts
51 18 2
private generatePropertiesStr()
in packages/appsync-modelgen-plugin/src/languages/swift-declaration-block.ts
31 18 1
addTypeUsed()
in packages/graphql-types-generator/src/compiler/index.ts
31 17 1
export function getConnectedField()
in packages/appsync-modelgen-plugin/src/utils/process-connections.ts
59 17 3
export default function getFields()
in packages/graphql-docs-generator/src/generator/getFields.ts
35 17 4
private generateFieldSchema()
in packages/appsync-modelgen-plugin/src/visitors/appsync-swift-visitor.ts
55 16 2
protected generateAddFields()
in packages/appsync-modelgen-plugin/src/visitors/appsync-dart-visitor.ts
74 16 1
async function generateTypes()
in packages/amplify-codegen/src/commands/types.js
65 16 4
export default function generate()
in packages/graphql-types-generator/src/generate.ts
77 15 7
export function nspawn()
in packages/amplify-codegen-e2e-core/src/utils/nexpect.ts
51 15 3
protected generateConstructor()
in packages/appsync-modelgen-plugin/src/visitors/appsync-dart-visitor.ts
49 15 2
private generateArgsStr()
in packages/appsync-modelgen-plugin/src/languages/swift-declaration-block.ts
16 15 1
export function pickedPropertyDeclarations()
in packages/graphql-types-generator/src/typescript/codeGeneration.ts
55 14 3
public get string()
in packages/appsync-modelgen-plugin/src/languages/dart-declaration-block.ts
39 14 0
async function generateStatements()
in packages/amplify-codegen/src/commands/statements.js
59 14 5