pytorch / elastic
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 114 units with 1,318 lines of code in units (52.4% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (151 lines of code)
    • 12 medium size units (372 lines of code)
    • 31 small units (449 lines of code)
    • 69 very small units (346 lines of code)
0% | 11% | 28% | 34% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 11% | 19% | 37% | 30%
go0% | 11% | 37% | 29% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
aws0% | 17% | 26% | 34% | 20%
kubernetes/controllers0% | 14% | 35% | 35% | 13%
kubernetes0% | 0% | 87% | 0% | 12%
kubernetes/api0% | 0% | 29% | 12% | 58%
azure0% | 0% | 9% | 41% | 48%
aws/auth0% | 0% | 0% | 61% | 38%
ROOT0% | 0% | 0% | 0% | 100%
torchelastic/distributed0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def parse_arguments()
in aws/petctl.py
80 1 2
func()
in kubernetes/controllers/job.go
71 15 1
func()
in kubernetes/controllers/elasticjob_controller.go
45 9 1
def run_job()
in aws/petctl.py
43 5 3
func main()
in kubernetes/main.go
34 4 0
def create_specs_file()
in aws/cloudformation.py
32 7 4
func onDependentCreateFunc()
in kubernetes/controllers/expectation.go
32 9 1
func onDependentDeleteFunc()
in kubernetes/controllers/expectation.go
32 9 1
func()
in kubernetes/controllers/elasticjob_controller.go
30 7 1
func SetClusterSpecForPod()
in kubernetes/controllers/pod.go
30 6 2
func()
in kubernetes/api/v1alpha1/zz_generated.deepcopy.go
29 6 1
22 2 1
def get_hostnames()
in aws/autoscaling.py
22 9 3
def cp()
in aws/s3.py
21 3 4
def wait_for()
in aws/util.py
20 4 4
def get_ami_id()
in aws/autoscaling.py
20 1 2
def list_hosts()
in aws/petctl.py
19 4 3
def create_asg()
in aws/autoscaling.py
19 3 6
func()
in kubernetes/controllers/service.go
18 4 1
func()
in kubernetes/controllers/job.go
18 4 1