facebookresearch / Clinical-Trial-Parser
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 428 units with 4,643 lines of code in units (80.9% of code).
    • 1 very long units (116 lines of code)
    • 7 long units (453 lines of code)
    • 46 medium size units (1,414 lines of code)
    • 76 small units (1,111 lines of code)
    • 298 very small units (1,549 lines of code)
2% | 9% | 30% | 23% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go2% | 10% | 28% | 23% | 34%
py0% | 0% | 53% | 24% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ct/parser9% | 20% | 27% | 17% | 26%
cmd/nel0% | 38% | 40% | 5% | 14%
ct/variables0% | 26% | 31% | 6% | 35%
ct/units0% | 36% | 21% | 12% | 29%
ie0% | 0% | 81% | 12% | 6%
ct/relation0% | 0% | 34% | 33% | 31%
ct/studies0% | 0% | 55% | 23% | 21%
vocabularies/taxonomy0% | 0% | 15% | 37% | 46%
common/trie0% | 0% | 51% | 33% | 15%
cmd/extract0% | 0% | 62% | 29% | 7%
cmd/cfg0% | 0% | 50% | 42% | 6%
cmd/search0% | 0% | 52% | 17% | 30%
common/util0% | 0% | 15% | 39% | 45%
vocabularies/umls0% | 0% | 100% | 0% | 0%
common/conf0% | 0% | 36% | 0% | 63%
vocabularies/mesh0% | 0% | 32% | 0% | 67%
ct/criteria0% | 0% | 0% | 47% | 52%
embedding0% | 0% | 0% | 63% | 36%
common/lsh0% | 0% | 0% | 54% | 45%
common/resource0% | 0% | 0% | 100% | 0%
common/col0% | 0% | 0% | 18% | 81%
text0% | 0% | 0% | 24% | 75%
vocabularies0% | 0% | 0% | 0% | 100%
ct/eligibility0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in src/ct/parser/cfg.go
116 33 1
func()
in src/cmd/nel/main.go
84 15 1
func LoadRules()
in src/ct/parser/rules.go
69 17 1
func()
in src/ct/parser/parser.go
68 25 1
func()
in src/ct/parser/parser.go
65 19 1
func()
in src/ct/parser/tree.go
57 16 1
func DefaultCatalog()
in src/ct/variables/variables.go
57 1 0
func DefaultCatalog()
in src/ct/units/units.go
53 1 0
func LoadNodes()
in src/vocabularies/taxonomy/node.go
49 10 1
func()
in src/ct/studies/study.go
47 11 1
func()
in src/ct/parser/parser.go
47 18 1
def transform()
in src/ie/process_ner_data.py
44 11 2
func Load()
in src/vocabularies/umls/umls.go
42 9 1
func lexAction()
in src/ct/parser/lexer.go
42 18 1
def main()
in src/ie/process_ner_data.py
41 6 3
func()
in src/ct/relation/relation.go
40 10 1
func Load()
in src/common/conf/conf.go
39 9 1
func()
in src/ct/parser/tree.go
38 9 1
func loadTaxonomy()
in src/vocabularies/mesh/mesh.go
37 9 1
func()
in src/ct/relation/relation.go
35 9 1