awslabs / kinesis-aggregation
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 267 units with 2,456 lines of code in units (72.9% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (198 lines of code)
    • 22 medium size units (723 lines of code)
    • 47 small units (683 lines of code)
    • 195 very small units (852 lines of code)
0% | 8% | 29% | 27% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 23% | 43% | 16% | 16%
java0% | 5% | 23% | 40% | 31%
py0% | 0% | 32% | 33% | 34%
go0% | 0% | 23% | 0% | 76%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
node/lib0% | 33% | 39% | 7% | 19%
java/KinesisTestProducers0% | 23% | 36% | 24% | 16%
python/aws_kinesis_agg0% | 0% | 43% | 26% | 30%
node/example0% | 0% | 53% | 37% | 9%
java/KinesisAggregator0% | 0% | 20% | 45% | 34%
java/KinesisAggregatorV20% | 0% | 21% | 38% | 40%
go/v20% | 0% | 23% | 0% | 76%
go/deaggregator0% | 0% | 80% | 0% | 19%
java/KinesisLambdaForwarder0% | 0% | 47% | 52% | 0%
python0% | 0% | 0% | 52% | 47%
java/KinesisDeaggregatorV20% | 0% | 0% | 45% | 54%
java/KinesisTestConsumers0% | 0% | 0% | 78% | 21%
java/KinesisDeaggregator0% | 0% | 0% | 52% | 48%
go/records0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
76 13 4
public static void main()
in java/KinesisTestProducers/src/main/java/com/amazonaws/kinesis/producer/SampleKPLProducer.java
65 3 1
function aggregateRecord()
in node/lib/kpl-agg.js
57 8 1
50 13 3
def iter_deaggregate_records()
in python/aws_kinesis_agg/deaggregator.py
50 9 2
function calculateRecordSize()
in node/lib/kpl-agg.js
42 10 2
func DeaggregateRecords()
in go/deaggregator/deaggregator.go
41 10 1
func DeaggregateRecords()
in go/v2/deaggregator/deaggregator.go
41 10 1
38 9 1
def add_user_record()
in python/aws_kinesis_agg/aggregator.py
37 14 4
public boolean addUserRecord()
in java/KinesisAggregator/src/main/java/com/amazonaws/kinesis/agg/AggRecord.java
34 8 3
public boolean addUserRecord()
in java/KinesisAggregatorV2/src/main/java/com/amazonaws/kinesis/agg/AggRecord.java
34 8 3
private static void executeAtTargetRate()
in java/KinesisTestProducers/src/main/java/com/amazonaws/kinesis/producer/SampleKPLProducer.java
32 4 5
private int calculateRecordSize()
in java/KinesisAggregator/src/main/java/com/amazonaws/kinesis/agg/AggRecord.java
31 4 3
private int calculateRecordSize()
in java/KinesisAggregatorV2/src/main/java/com/amazonaws/kinesis/agg/AggRecord.java
31 4 3
handleNoProcess()
in node/example/sample-deaggregation.js
31 5 2
function generateEncodedRecord()
in node/lib/kpl-agg.js
30 7 1
handleNoProcess()
in node/example/sample-deaggregation.js
29 4 2
public Void handleRequest()
in java/KinesisLambdaForwarder/src/main/java/com/amazonaws/kinesis/forwarder/LambdaAggregatingForwarder.java
28 4 2
handleNoProcess()
in node/example/sample-aggregation.js
27 2 2