File Complexity Overall
  • There are 604 files with units, with 55,430 lines of code.
    • 0 very complex files (McCabe index sum 251+; 0 lines of code)
    • 0 complex files (McCabe index sum 126-250; 0 lines of code)
    • 6 medium complex files (McCabe index sum 51-125; 3,384 lines of code)
    • 22 slightly complex files (McCabe index sum 26-50; 5,718 lines of code)
    • 576 simple files (McCabe index sum 1-25; 46,328 lines of code)
  • 516 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system0% | 0% | 6% | 10% | 83%
Legend:
251+
126-250
51-125
26-50
1-25


explore: grouped by folders | grouped by complexity
File Complexity per Extension
251+
126-250
51-125
26-50
1-25
scala0% | 0% | 9% | 6% | 84%
tsx0% | 0% | 4% | 8% | 86%
ts0% | 0% | 3% | 20% | 75%
js0% | 0% | 0% | 0% | 100%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
support-frontend0% | 0% | 7% | 9% | 82%
support-workers0% | 0% | 12% | 20% | 67%
cdk0% | 0% | 0% | 24% | 75%
support-payment-api0% | 0% | 0% | 10% | 89%
support-models0% | 0% | 0% | 9% | 90%
stripe-patrons-data0% | 0% | 0% | 26% | 73%
support-modules0% | 0% | 0% | 0% | 100%
supporter-product-data0% | 0% | 0% | 0% | 100%
support-services0% | 0% | 0% | 0% | 100%
support-internationalisation0% | 0% | 0% | 0% | 100%
support-lambdas0% | 0% | 0% | 0% | 100%
support-config0% | 0% | 0% | 0% | 100%
support-backend0% | 0% | 0% | 0% | 100%
.github0% | 0% | 0% | 0% | 100%
project0% | 0% | 0% | 0% | 100%
support-e2e0% | 0% | 0% | 0% | 100%
Most Complex Files (Top 50)

The McCabe index of a file grows with its size: per 100 lines tells a large but plain file from a dense one, and most complex unit whether the complexity sits in one unit or is spread over many.

File# lines# unitsMcCabe index
(sum)
per 100
lines
most complex
unit
oneTimeCheckoutComponent.tsx
in support-frontend/assets/pages/[countryGroupId]/components
1196 14 113 9 70
CheckoutValidationRules.scala
in support-frontend/app/utils
590 18 86 15 15
acquisitionDataRowBuilder.ts
in support-workers/src/typescript/acquisitionData
315 17 75 24 17
CreateSubscriptionController.scala
in support-frontend/app/controllers
510 16 62 12 8
Application.scala
in support-frontend/app/controllers
632 28 60 9 9
billingPeriods.ts
in support-frontend/assets/helpers/productPrice
141 7 53 38 24
CheckoutFailureReasons.scala
in support-models/src/main/scala/com/gu/support/workers
101 2 45 45 44
thankYouComponent.tsx
in support-frontend/assets/pages/[countryGroupId]/components
326 2 45 14 28
StripeBackend.scala
in support-payment-api/src/main/scala/backend
346 11 41 12 19
quantumMetric.ts
in support-frontend/assets/helpers/tracking
325 21 40 12 4
sendThankYouEmailLambda.ts
in support-workers/src/typescript/lambdas
274 31 39 14 4
googleTagManager.ts
in support-frontend/assets/helpers/tracking
182 16 39 21 5
PaymentFields.scala
in support-models/src/main/scala/com/gu/support/workers
110 6 38 35 11
countryGroup.ts
in support-frontend/assets/helpers/internationalisation/classes
113 8 35 31 15
abtest.ts
in support-frontend/assets/helpers/abTests
292 11 35 12 8
testimonialsContainer.tsx
in support-frontend/assets/pages/aus-moment-map/components
326 8 34 10 20
acquisitions.ts
in support-frontend/assets/helpers/tracking
271 13 34 13 7
frontend.ts
in cdk/lib
539 31 33 6 3
onboardingInviteeComponent.tsx
in support-frontend/assets/pages/[countryGroupId]/components
240 1 33 14 33
checkoutNudge.tsx
in support-frontend/assets/components/checkoutNudge
404 5 32 8 12
stateSchemas.ts
in support-workers/src/typescript/model
164 31 31 19 1
threeTierLanding.tsx
in support-frontend/assets/pages/supporter-plus-landing/twoStepPages
504 12 31 6 11
country.ts
in support-frontend/assets/helpers/internationalisation/classes
160 11 30 19 6
address.ts
in support-workers/src/typescript/model
101 11 27 27 13
HttpIdentityService.scala
in support-frontend/app/services
303 13 27 9 6
router.tsx
in support-frontend/assets/pages/[countryGroupId]
296 23 27 9 3
utilities.ts
in support-frontend/assets/helpers/utilities
134 10 27 20 6
PatronCancelledEventLambda.scala
in stripe-patrons-data/src/main/scala/com/gu/patrons/lambdas
207 10 27 13 6
InvitationController.scala
in support-frontend/app/controllers
123 6 25 20 7
onboardingComponent.tsx
in support-frontend/assets/pages/[countryGroupId]/components
273 1 25 9 25
getWeeklyProducts.tsx
in support-frontend/assets/pages/weekly-subscription-landing/helpers
200 7 25 13 6
WebServiceHelper.scala
in support-modules/rest/src/main/scala/com/gu/rest
158 9 24 15 4
thankYouModule.stories.tsx
in support-frontend/stories/checkouts
393 24 24 6 1
contributionsOrderSummary.tsx
in support-frontend/assets/components/orderSummary
312 1 24 8 24
paymentTsAndCs.tsx
in support-frontend/assets/pages/supporter-plus-landing/components
351 10 23 7 8
PaypalBackend.scala
in support-payment-api/src/main/scala/backend
263 9 21 8 4
thankYouModuleData.tsx
in support-frontend/assets/components/thankYou
403 18 21 5 2
links.tsx
in support-frontend/assets/components/headers/links
171 4 21 12 16
checkoutForm.tsx
in support-frontend/assets/pages/[countryGroupId]/components
1192 7 21 2 5
errorReasons.ts
in support-frontend/assets/helpers/forms
71 2 21 30 20
Product.scala
in support-models/src/main/scala/com/gu/support/catalog
487 8 20 4 7
CountryGroup.scala
in support-internationalisation/src/main/scala/com/gu/i18n
367 4 20 5 17
UserFromAuthCookiesActionBuilder.scala
in support-frontend/app/actions
185 7 20 11 6
AuthCodeFlowController.scala
in support-frontend/app/controllers
150 7 20 13 8
invitation.ts
in support-frontend/assets/helpers/onboardingInvitee
127 4 20 16 8
checkoutNudgeAbTests.ts
in support-frontend/assets/helpers/abTests
158 2 20 13 14
subscriptionCopy.tsx
in support-frontend/assets/pages/subscriptions-landing/copy
208 15 19 9 3
deliveryAgentsSelect.tsx
in support-frontend/assets/pages/paper-subscription-checkout/components
206 8 19 9 7
JsonHelpers.scala
in support-models/src/main/scala/com/gu/support/encoding
97 8 18 19 8
PaperRound.scala
in support-frontend/app/controllers
104 4 18 17 10
About This Analysis
  • File complexity is the sum of the McCabe indexes (conditional complexity) of the units (methods, functions...) in a file.
  • Files are classified in five categories based on that sum: 1-25 (simple files), 26-50 (slightly complex files), 51-125 (medium complex files), 126-250 (complex files), 251+ (very complex files). The default bands are five times the unit complexity bands, as a file is a group of units.
  • Only main code files with units are classified. Files without units (languages without unit analysis, or files without functions) have no complexity to measure and are left out rather than counted as simple.
  • A very complex file holds many decisions, which often means it has too many responsibilities: a candidate to split, and a place where changes need more testing.
Learn more...