facebookresearch / SentAugment
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 9 units with 124 lines of code in units (62.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (51 lines of code)
    • 0 medium size units (0 lines of code)
    • 4 small units (47 lines of code)
    • 4 very small units (26 lines of code)
0% | 41% | 0% | 37% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 41% | 0% | 37% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 41% | 0% | 37% | 20%
Alternative Visuals
Longest Units
Top 9 longest units
Unit# linesMcCabe index# params
def main()
in src/sase.py
51 9 0
def IndexSearchKNN()
in src/indexing.py
13 6 6
def IndexTextOpen()
in src/indexing.py
12 3 1
def IndexCreate()
in src/indexing.py
11 2 5
def IndexLoad()
in src/indexing.py
11 2 3
def IndexTextQuery()
in src/indexing.py
9 3 3
def CompressText()
in src/indexing.py
8 2 1
def main()
in src/compress_text.py
5 1 0
def LoadTextSimple()
in src/indexing.py
4 2 1