File Complexity Overall
  • There are 386 files with units, with 34,684 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)
    • 9 medium complex files (McCabe index sum 51-125; 5,086 lines of code)
    • 22 slightly complex files (McCabe index sum 26-50; 4,681 lines of code)
    • 355 simple files (McCabe index sum 1-25; 24,917 lines of code)
  • 246 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system0% | 0% | 14% | 13% | 71%
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% | 23% | 15% | 60%
tsx0% | 0% | 7% | 13% | 78%
ts0% | 0% | 0% | 5% | 94%
js0% | 0% | 0% | 0% | 100%
java0% | 0% | 0% | 0% | 100%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
backend0% | 0% | 25% | 15% | 58%
frontend0% | 0% | 5% | 10% | 84%
project0% | 0% | 82% | 0% | 17%
cli0% | 0% | 0% | 23% | 76%
common0% | 0% | 0% | 21% | 78%
transcription-worker-interface0% | 0% | 0% | 0% | 100%
infra0% | 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
Neo4jAnnotations.scala
in backend/app/services/annotations
708 28 118 17 33
Neo4jManifest.scala
in backend/app/services/manifest
1206 44 89 7 8
HitReaders.scala
in backend/app/services/index
324 29 76 23 10
ElasticsearchResources.scala
in backend/app/services/index
940 32 70 7 7
297 15 70 24 13
Workspaces.scala
in backend/app/controllers/api
394 28 66 17 5
UploadFiles.tsx
in frontend/src/js/components/Uploads
458 17 63 14 18
Viewer.tsx
in frontend/src/js/components/viewer
362 10 59 16 19
Neo4jUserManagement.scala
in backend/app/services/users
397 24 54 14 6
Workspaces.tsx
in frontend/src/js/components/workspace
1364 17 49 4 16
ErrorFormatter.scala
in cli/src/main/scala/com/gu/pfi/cli
78 3 49 63 27
Ocr.scala
in backend/app/utils
244 7 48 20 24
WorkerControl.scala
in backend/app/utils
217 17 47 22 12
resourceUtils.ts
in frontend/src/js/util
154 15 46 30 9
FailureToResultMapper.scala
in backend/app/utils/controller
154 4 45 29 40
ExternalTranscriptionWorker.scala
in backend/app/extraction
257 13 45 18 15
Neo4jHelper.scala
in backend/app/utils
255 23 43 17 7
Search.scala
in backend/app/controllers/api
159 11 42 26 10
PreviewService.scala
in backend/app/services/previewing
137 13 42 31 10
Attempt.scala
in common/src/main/scala/utils/attempt
135 20 42 31 5
Collections.scala
in backend/app/controllers/api
241 15 40 17 6
CommandValidator.scala
in cli/src/main/scala/com/gu/pfi/cli
107 8 37 35 8
ExcelTableExtractor.scala
in backend/app/extraction/tables
129 5 36 28 9
CliHttpClient.scala
in cli/src/main/scala/com/gu/pfi/cli/service
147 12 31 21 7
HtmlToPlainText.scala
in backend/app/utils
93 5 30 32 10
Email.scala
in backend/app/model
178 8 30 17 10
Chip.scala
in backend/app/model/frontend
93 3 29 31 17
pageViewerApi.ts
in frontend/src/js/components/viewer/PageViewer
103 17 27 26 3
CommentHighlighter.tsx
in frontend/src/js/components/viewer
143 5 27 19 10
GetResource.scala
in backend/app/commands
128 6 27 21 7
IngestStorePolling.scala
in backend/app/ingestion/phase2
165 8 26 16 9
parseDate.ts
in frontend/src/js/util
112 6 25 22 16
EmlParser.scala
in backend/app/extraction/email/eml
126 8 25 20 11
Preview.tsx
in frontend/src/js/components/viewer
137 3 24 18 21
AwsDiscovery.scala
in backend/app/utils
226 9 24 11 6
IngestionServices.scala
in backend/app/services/ingestion
178 11 24 13 8
Models.scala
in backend/app/services/observability
184 9 24 13 5
HighlightFields.scala
in backend/app/services/index
112 9 24 21 8
workspaceUtils.ts
in frontend/src/js/util
117 7 23 20 7
workspaceNavigation.ts
in frontend/src/js/util
136 6 23 17 8
Users.scala
in backend/app/controllers/api
111 10 23 21 4
Blobs.scala
in backend/app/controllers/api
122 7 23 19 6
PagesController.scala
in backend/app/controllers/api
141 9 23 16 5
treeUtils.ts
in frontend/src/js/util
127 10 22 17 6
CommentPanel.tsx
in frontend/src/js/components/viewer/CommentPanel
279 6 22 8 10
WorkspaceApi.ts
in frontend/src/js/services
228 21 22 10 2
Resource.scala
in backend/app/model/frontend
170 8 22 13 7
Worker.scala
in backend/app/extraction
153 7 22 14 8
ElasticsearchSyntax.scala
in backend/app/services
126 11 22 17 4
TreeEntry.scala
in backend/app/model/frontend
76 4 21 28 7
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...