File Complexity Overall
  • There are 712 files with units, with 66,401 lines of code.
    • 1 very complex files (McCabe index sum 251+; 625 lines of code)
    • 4 complex files (McCabe index sum 126-250; 4,002 lines of code)
    • 17 medium complex files (McCabe index sum 51-125; 7,525 lines of code)
    • 40 slightly complex files (McCabe index sum 26-50; 10,085 lines of code)
    • 650 simple files (McCabe index sum 1-25; 44,164 lines of code)
  • 1,380 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system<1% | 6% | 11% | 15% | 66%
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
js5% | 5% | 24% | 4% | 59%
scala0% | 6% | 8% | 17% | 67%
java0% | 0% | 0% | 72% | 27%
ts0% | 0% | 0% | 0% | 100%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
admin14% | 0% | 0% | 5% | 80%
common0% | 10% | 9% | 24% | 54%
static0% | 5% | 24% | 3% | 66%
facia-press0% | 0% | 49% | 0% | 50%
facia0% | 0% | 38% | 0% | 61%
article0% | 0% | 24% | 11% | 63%
applications0% | 0% | 7% | 13% | 79%
sport0% | 0% | 0% | 11% | 88%
commercial0% | 0% | 0% | 28% | 71%
onward0% | 0% | 0% | 11% | 88%
template-tracker-agent0% | 0% | 0% | 72% | 27%
archive0% | 0% | 0% | 77% | 22%
identity0% | 0% | 0% | 0% | 100%
discussion0% | 0% | 0% | 0% | 100%
preview0% | 0% | 0% | 0% | 100%
project0% | 0% | 0% | 0% | 100%
dev-build0% | 0% | 0% | 0% | 100%
tools0% | 0% | 0% | 0% | 100%
rss0% | 0% | 0% | 0% | 100%
dev0% | 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
interactiveSwfScript.js
in admin/conf/resources/r2
625 45 255 41 21
PageElement.scala
in common/app/model/dotcomrendering/pageElements
2169 26 182 8 72
HtmlCleaner.scala
in common/app/views/support
777 49 172 22 20
Formats.scala
in common/app/model
364 21 153 42 21
crossword.js
in static/src/javascripts/projects/common/modules/crosswords
692 51 143 21 14
comment-box.js
in static/src/javascripts/projects/common/modules/discussion
537 25 112 21 22
loader.js
in static/src/javascripts/projects/common/modules/discussion
487 23 106 22 21
meta.scala
in common/app/model
799 22 104 13 22
EmailSignupController.scala
in common/app/controllers
678 26 104 15 10
lightbox.js
in static/src/javascripts/projects/common/modules/gallery
564 41 88 16 10
FapiFrontPress.scala
in facia-press/app/frontpress
579 29 88 15 10
FaciaController.scala
in facia/app/controllers
450 25 87 19 19
comments.js
in static/src/javascripts/projects/common/modules/discussion
511 18 86 17 15
gallery.js
in static/src/javascripts/projects/commercial/modules/hosted
512 25 85 17 12
EmailAddons.scala
in common/app/model
504 41 80 16 2
PuzzlesLayout.scala
in common/app/model
229 4 69 30 62
DotcomRenderingUtils.scala
in common/app/model/dotcomrendering
302 25 63 21 8
LiveBlogController.scala
in article/app/controllers
336 15 58 17 10
component.js
in static/src/javascripts/projects/common/modules
248 20 57 23 8
PuzzlesPageController.scala
in applications/app/controllers
314 20 56 18 7
Commercial.scala
in common/app/views/support
247 19 55 22 12
IndexPage.scala
in common/app/services
228 8 51 22 27
ArchiveController.scala
in archive/app/controllers
139 14 50 36 12
DotcomRenderingService.scala
in common/app/renderers
527 28 49 9 9
Navigation.scala
in common/app/navigation
284 11 47 17 10
content.scala
in common/app/model
951 16 47 5 15
message.js
in static/src/javascripts/projects/common/modules/ui
187 10 47 25 15
HostedContentController.scala
in commercial/app/controllers
277 10 45 16 12
TrailsToShowcase.scala
in common/app/common
590 24 44 7 8
ImageProfile.scala
in common/app/views/support
364 17 44 12 15
assets.scala
in common/app/common/Assets
133 11 42 32 12
CalloutExtraction.scala
in common/app/model/dotcomrendering/pageElements
360 14 41 11 11
matches.scala
in sport/app/football/model
185 15 40 22 8
BlockElement.scala
in common/app/model/liveblog
208 5 40 19 34
Competitions.scala
in sport/app/football/feed
415 14 38 9 7
search-tool.js
in static/src/javascripts/projects/facia/modules/onwards
192 17 36 19 7
Atom.scala
in common/app/model/content
483 23 35 7 5
ImageContentController.scala
in applications/app/controllers
156 6 35 22 23
UrlHelpers.scala
in common/app/navigation/helpers
85 4 34 40 26
package.scala
in common/app/common
186 13 34 18 11
DotcomRenderingDataModel.scala
in common/app/model/dotcomrendering
645 11 34 5 15
FaciaCard.scala
in common/app/layout
223 8 33 15 7
package.scala
in common/app/views/support
182 19 33 18 6
PuzzlesLayoutProvider.scala
in applications/app/controllers
255 10 33 13 8
ArticleController.scala
in article/app/controllers
161 9 33 20 13
TemplateTracker.java
in template-tracker-agent/src/main/java/com/gu/templatetracker
141 7 32 23 6
ModelOrResult.scala
in common/app/common
92 7 32 35 11
applyRenderConditions.scala.js
in common/app/templates/inlineJS/blocking
106 10 32 30 14
EditionAdTargeting.scala
in common/app/common/commercial
85 9 31 36 15
LinkedData.scala
in common/app/model/dotcomrendering
411 9 31 8 9
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...