aws-samples / amazon-emr-with-juicefs
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 34 units with 688 lines of code in units (73.1% of code).
    • 1 very long units (241 lines of code)
    • 2 long units (146 lines of code)
    • 3 medium size units (90 lines of code)
    • 9 small units (126 lines of code)
    • 19 very small units (85 lines of code)
35% | 21% | 13% | 18% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts80% | 0% | 8% | 4% | 7%
py0% | 36% | 11% | 30% | 21%
java0% | 40% | 25% | 27% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/lib80% | 0% | 8% | 4% | 7%
source/benchmark-sample0% | 36% | 11% | 30% | 21%
source/benchmark-sample/tpcds-gen/src/main/java/org/notmysock/tpcds0% | 40% | 25% | 27% | 7%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/lib/cdk-solution-stack.ts
241 3 3
def main()
in source/benchmark-sample/emr-benchmark.py
84 5 0
public int run()
in source/benchmark-sample/tpcds-gen/src/main/java/org/notmysock/tpcds/GenTable.java
62 7 1
protected void map()
in source/benchmark-sample/tpcds-gen/src/main/java/org/notmysock/tpcds/GenTable.java
39 8 3
def run()
in source/benchmark-sample/run-query.py
27 7 3
constructor()
in source/lib/cdk-solution-stack.ts
24 1 3
public Path copyJar()
in source/benchmark-sample/tpcds-gen/src/main/java/org/notmysock/tpcds/GenTable.java
17 1 1
def main()
in source/benchmark-sample/run-query.py
16 4 0
public Path genInput()
in source/benchmark-sample/tpcds-gen/src/main/java/org/notmysock/tpcds/GenTable.java
15 3 3
def mkres()
in source/benchmark-sample/emr-benchmark.py
15 6 5
def run_query()
in source/benchmark-sample/emr-benchmark.py
15 5 7
def gen_benchmark_data()
in source/benchmark-sample/emr-benchmark.py
13 3 4
private get _defaultJobFlowRoleProfile()
in source/lib/cdk-solution-stack.ts
12 1 0
def cleanup_benchmark_data()
in source/benchmark-sample/emr-benchmark.py
12 1 3
static String readToString()
in source/benchmark-sample/tpcds-gen/src/main/java/org/notmysock/tpcds/GenTable.java
11 2 1
def mkplot()
in source/benchmark-sample/emr-benchmark.py
10 3 5
private get _defaultServiceRole()
in source/lib/cdk-solution-stack.ts
8 1 0
function paramGroup()
in source/lib/cdk-solution-stack.ts
8 2 2
function assertenv()
in source/lib/cdk-solution-stack.ts
7 3 1
def elapse()
in source/benchmark-sample/emr-benchmark.py
6 1 3