awslabs / amazon-timestream-tools
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 910 units with 16,264 lines of code in units (75.4% of code).
    • 15 very long units (2,483 lines of code)
    • 27 long units (1,859 lines of code)
    • 192 medium size units (5,577 lines of code)
    • 281 small units (4,101 lines of code)
    • 395 very small units (2,244 lines of code)
15% | 11% | 34% | 25% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go29% | 11% | 30% | 23% | 5%
cs17% | 14% | 43% | 16% | 7%
java8% | 6% | 31% | 34% | 18%
py8% | 19% | 32% | 15% | 24%
js6% | 7% | 40% | 30% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sample_apps/go69% | 0% | 19% | 7% | 3%
sample_apps_reinvent2021/goV223% | 11% | 32% | 25% | 6%
sample_apps_reinvent2021/go20% | 15% | 32% | 26% | 4%
sample_apps_reinvent2021/dotnet17% | 20% | 36% | 18% | 6%
sample_apps_reinvent2021/python31% | 0% | 19% | 11% | 37%
integrations/jdbc55% | 0% | 9% | 16% | 18%
sample_apps/dotnet16% | 0% | 60% | 11% | 11%
sample_apps_reinvent2021/javaV29% | 9% | 26% | 39% | 16%
sample_apps/js18% | 0% | 41% | 22% | 17%
sample_apps_reinvent2021/java9% | 0% | 38% | 38% | 13%
tools/perf-scale-workload0% | 32% | 41% | 11% | 14%
sample_apps_reinvent2021/js0% | 11% | 40% | 35% | 12%
sample_apps/javaV20% | 18% | 30% | 32% | 18%
sample_apps/java0% | 14% | 33% | 40% | 11%
integrations/sagemaker0% | 45% | 0% | 29% | 25%
sample_apps/python0% | 17% | 24% | 21% | 36%
tools/continuous-ingestor0% | 23% | 37% | 24% | 13%
tools/multithreaded-writer0% | 9% | 31% | 34% | 24%
integrations/flink_connector_with_upserts0% | 0% | 46% | 18% | 34%
tools/kinesis_ingestor0% | 0% | 81% | 8% | 9%
integrations/flink_connector0% | 0% | 31% | 28% | 40%
integrations/iot_core0% | 0% | 0% | 70% | 30%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in sample_apps/go/crud-ingestion-sample.go
350 18 0
def __init__()
in sample_apps_reinvent2021/python/utils/QueryUtil.py
210 15 4
func main()
in sample_apps_reinvent2021/goV2/scheduled-query-sample.go
200 34 0
func main()
in sample_apps_reinvent2021/go/scheduled-query-sample.go
198 34 0
public QueryExample()
in integrations/jdbc/src/main/java/com/amazonaws/services/timestream/QueryExample.java
198 1 2
public async Task RunScheduledQueryExample()
in sample_apps_reinvent2021/dotnet/ScheduledQueryExample.cs
173 28 2
func ExecuteSampleQueries()
in sample_apps_reinvent2021/goV2/query-sample.go
159 2 4
func ExecuteSampleQueries()
in sample_apps_reinvent2021/go/query-sample.go
153 2 4
public async Task WriteRecordsWithUpsert()
in sample_apps_reinvent2021/dotnet/CrudAndSimpleIngestionExample.cs
152 9 0
func main()
in sample_apps/go/ingestion-csv-sample.go
130 14 0
public async Task WriteRecordsWithUpsert()
in sample_apps/dotnet/CrudAndSimpleIngestionExample.cs
121 9 0
private static void scheduledQueryExamples()
in sample_apps_reinvent2021/javaV2/src/main/java/com/amazonaws/services/timestream/Main.java
114 24 5
async function writeRecordsWithUpsert()
in sample_apps/js/crud-and-simple-ingestion-example.js
113 5 0
public static void scheduledQueryExamples()
in sample_apps_reinvent2021/java/src/main/java/com/amazonaws/services/timestream/Main.java
110 23 6
func main()
in sample_apps_reinvent2021/goV2/ingestion-csv-sample.go
102 17 0
public void writeRecordsWithUpsert()
in sample_apps/javaV2/src/main/java/com/amazonaws/services/timestream/CrudAndSimpleIngestionExample.java
98 9 0
func main()
in sample_apps_reinvent2021/goV2/crud-ingestion-sample.go
95 7 0
async function scheduledQueryExamples()
in sample_apps_reinvent2021/js/main.js
92 18 0
def run()
in tools/perf-scale-workload/continuous_ingester.py
91 16 1
public void writeRecordsWithUpsert()
in sample_apps/java/src/main/java/com/amazonaws/services/timestream/CrudAndSimpleIngestionExample.java
83 9 0