File Complexity Overall
  • There are 447 files with units, with 46,628 lines of code.
    • 0 very complex files (McCabe index sum 251+; 0 lines of code)
    • 4 complex files (McCabe index sum 126-250; 2,523 lines of code)
    • 31 medium complex files (McCabe index sum 51-125; 12,276 lines of code)
    • 43 slightly complex files (McCabe index sum 26-50; 8,327 lines of code)
    • 369 simple files (McCabe index sum 1-25; 23,502 lines of code)
  • 364 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system0% | 5% | 26% | 17% | 50%
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
java0% | 12% | 50% | 14% | 22%
js0% | 5% | 14% | 20% | 59%
scala0% | 2% | 22% | 19% | 55%
ts0% | 0% | 0% | 5% | 94%
tsx0% | 0% | 0% | 0% | 100%
py0% | 0% | 0% | 0% | 100%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
scripts0% | 11% | 44% | 17% | 26%
kahuna0% | 4% | 13% | 20% | 60%
common-lib0% | 6% | 11% | 12% | 69%
media-api0% | 0% | 59% | 12% | 28%
image-loader0% | 0% | 49% | 10% | 39%
thrall0% | 0% | 41% | 18% | 40%
usage0% | 0% | 0% | 50% | 50%
rest-lib0% | 0% | 0% | 29% | 70%
cropper0% | 0% | 0% | 38% | 61%
metadata-editor0% | 0% | 0% | 21% | 78%
leases0% | 0% | 0% | 63% | 36%
image-embedder-lambda0% | 0% | 0% | 0% | 100%
collections0% | 0% | 0% | 0% | 100%
dev0% | 0% | 0% | 0% | 100%
cdk0% | 0% | 0% | 0% | 100%
auth0% | 0% | 0% | 0% | 100%
image-cache-purger0% | 0% | 0% | 0% | 100%
quarantine-status0% | 0% | 0% | 0% | 100%
image-counter-lambda0% | 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
SimpleConfig.java
in scripts/src/main/java/com/gu/typesafe/config/impl
940 83 205 22 24
query.js
in kahuna/public/js/search
596 37 150 25 31
SupplierProcessors.scala
in common-lib/src/main/scala/com/gu/mediaservice/lib/cleanup
515 41 135 26 11
SimpleConfigOrigin.java
in scripts/src/main/java/com/gu/typesafe/config/impl
472 29 134 28 22
SimpleConfigObject.java
in scripts/src/main/java/com/gu/typesafe/config/impl
542 37 122 23 23
MediaApi.scala
in media-api/app/controllers
711 27 121 17 23
gr-image-metadata.js
in kahuna/public/js/components/gr-image-metadata
561 25 100 18 29
ElasticSearch.scala
in thrall/app/lib/elasticsearch
678 36 94 14 9
Tokens.java
in scripts/src/main/java/com/gu/typesafe/config/impl
421 72 94 22 5
ConfigNodeObject.java
in scripts/src/main/java/com/gu/typesafe/config/impl
241 9 92 38 38
SerializedConfigValue.java
in scripts/src/main/java/com/gu/typesafe/config/impl
440 23 85 19 20
Parseable.java
in scripts/src/main/java/com/gu/typesafe/config/impl
643 41 76 12 8
ConfigImplUtil.java
in scripts/src/main/java/com/gu/typesafe/config/impl
235 14 75 32 15
results.js
in kahuna/public/js/search
730 22 72 10 10
AbstractConfigValue.java
in scripts/src/main/java/com/gu/typesafe/config/impl
279 37 72 26 9
ConfigDocumentParser.java
in scripts/src/main/java/com/gu/typesafe/config/impl
576 20 71 12 9
ConfigBeanImpl.java
in scripts/src/main/java/com/gu/typesafe/config/impl
245 7 71 29 24
ResolveSource.java
in scripts/src/main/java/com/gu/typesafe/config/impl
269 19 70 26 10
Tokenizer.java
in scripts/src/main/java/com/gu/typesafe/config/impl
558 29 69 12 11
UsageRights.scala
in common-lib/src/main/scala/com/gu/mediaservice/model
498 32 67 13 4
ElasticSearch.scala
in media-api/app/lib/elasticsearch
581 24 67 12 10
QueryBuilder.scala
in media-api/app/lib/elasticsearch
188 6 66 35 26
GridClient.scala
in common-lib/src/main/scala/com/gu/mediaservice
229 21 64 28 4
ImageLoaderController.scala
in image-loader/app/controllers
570 13 63 11 13
ConfigFactory.java
in scripts/src/main/java/com/gu/typesafe/config
293 60 63 22 2
ConfigException.java
in scripts/src/main/java/com/gu/typesafe/config
277 54 63 23 5
QuerySyntax.scala
in media-api/app/lib/querysyntax
222 30 62 28 15
SimpleConfigList.java
in scripts/src/main/java/com/gu/typesafe/config/impl
372 35 61 16 11
ImageOperations.scala
in common-lib/src/main/scala/com/gu/mediaservice/lib/imaging
247 13 58 23 26
image-editor.js
in kahuna/public/js/edits
379 14 55 15 22
MessageProcessor.scala
in thrall/app/lib/kinesis
189 12 55 29 23
MessageTranslator.scala
in thrall/app/lib/kinesis
83 1 53 64 53
Uploader.scala
in image-loader/app/model
451 17 51 11 7
PathParser.java
in scripts/src/main/java/com/gu/typesafe/config/impl
207 14 51 25 14
ImageResponse.scala
in media-api/app/lib
361 18 51 14 8
ProviderLoader.scala
in common-lib/src/main/scala/com/gu/mediaservice/lib/config
172 15 49 28 6
main.js
in kahuna/public/js
426 23 47 11 9
ConfigImpl.java
in scripts/src/main/java/com/gu/typesafe/config/impl
422 27 47 11 5
DynamoDB.scala
in common-lib/src/main/scala/com/gu/mediaservice/lib/aws
220 27 47 21 9
service.js
in kahuna/public/js/edits
195 21 44 23 8
ConfigConcatenation.java
in scripts/src/main/java/com/gu/typesafe/config/impl
217 15 44 20 19
metadata-templates.js
in kahuna/public/js/metadata-templates
189 10 43 23 12
UsageGroup.scala
in usage/app/model
246 22 42 17 5
ProposeS3Changes.scala
in scripts/src/main/scala/com/gu/mediaservice/scripts
219 8 41 19 12
usage-rights-editor.js
in kahuna/public/js/usage-rights
220 8 40 18 22
Path.java
in scripts/src/main/java/com/gu/typesafe/config/impl
177 17 40 23 6
EsScript.scala
in scripts/src/main/scala/com/gu/mediaservice/scripts
354 7 40 11 19
ElasticSearchModel.scala
in media-api/app/lib/elasticsearch
252 10 39 15 11
Subject.scala
in common-lib/src/main/scala/com/gu/mediaservice/lib/metadata
62 1 38 61 38
UsageApi.scala
in usage/app/controllers
382 14 37 10 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...