aws-samples / amazon-neptune-samples
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 242 units with 2,654 lines of code in units (8.3% of code).
    • 2 very long units (405 lines of code)
    • 7 long units (519 lines of code)
    • 18 medium size units (538 lines of code)
    • 28 small units (405 lines of code)
    • 187 very small units (787 lines of code)
15% | 19% | 20% | 15% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts63% | 24% | 10% | 0% | <1%
java0% | 26% | 20% | 13% | 39%
py0% | 7% | 17% | 31% | 43%
js0% | 0% | 85% | 8% | 5%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
amazon-neptune-and-aws-cdk-for-amundsen/lib58% | 29% | 9% | 0% | 2%
gremlin/neptune-social-media-utils0% | 40% | 21% | 12% | 25%
gremlin/chatbot-full-stack-application0% | 0% | 85% | 8% | 5%
gremlin/gremlin-java-client-demo0% | 0% | 17% | 15% | 66%
gremlin/neptune-streams0% | 0% | 13% | 33% | 52%
gremlin/glue-neptune0% | 0% | 38% | 34% | 27%
neptune-sagemaker/notebooks0% | 0% | 31% | 13% | 54%
neptune-sagemaker/lambda0% | 0% | 0% | 82% | 17%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in amazon-neptune-and-aws-cdk-for-amundsen/lib/amundsen-stack.ts
303 1 3
constructor()
in amazon-neptune-and-aws-cdk-for-amundsen/lib/vpc-stack.ts
102 1 3
constructor()
in amazon-neptune-and-aws-cdk-for-amundsen/lib/databuilder-stack.ts
94 1 3
public static GSONSchema configToSchema()
in gremlin/neptune-social-media-utils/src/main/java/com/aws/neptune/utils/generator/GSONUtil.java
94 15 1
public IdBean getRandomPairIdForRelation()
in gremlin/neptune-social-media-utils/src/main/java/com/aws/neptune/utils/generator/IdStore.java
91 35 0
public void writeEdgeCSVs()
in gremlin/neptune-social-media-utils/src/main/java/com/aws/neptune/utils/generator/CSVGenerator.java
63 14 3
constructor()
in amazon-neptune-and-aws-cdk-for-amundsen/lib/bastion-stack.ts
62 1 3
private ArrayList generateOneRecord()
in gremlin/neptune-social-media-utils/src/main/java/com/aws/neptune/utils/generator/CSVGenerator.java
62 17 1
def create_es_publisher_sample_job()
in amazon-neptune-and-aws-cdk-for-amundsen/lib/databuilders/postgres/postgres_extract_neptune_publish.py
53 3 5
public IdBean getRandomIdForRelation()
in gremlin/neptune-social-media-utils/src/main/java/com/aws/neptune/utils/generator/IdStore.java
43 13 1
public Cluster create()
in gremlin/gremlin-java-client-demo/src/main/java/org/apache/tinkerpop/gremlin/driver/NeptuneClusterBuilder.java
41 11 0
constructor()
in amazon-neptune-and-aws-cdk-for-amundsen/lib/redshift-stack.ts
40 1 3
public static BatchImporterDataMap toDataMap()
in gremlin/neptune-social-media-utils/src/main/java/com/aws/neptune/utils/generator/GSONUtil.java
35 7 1
public static void isValidConfig()
in gremlin/neptune-social-media-utils/src/main/java/com/aws/neptune/utils/generator/CSVGenerator.java
33 10 1
function registerValidSW()
in gremlin/chatbot-full-stack-application/code/web-ui/neptune-chatbot/src/serviceWorker.js
33 8 2
def lambda_handler()
in gremlin/neptune-streams/lambda/neptune-streams-demo/neptune_workload.py
31 8 2
public void run()
in gremlin/gremlin-java-client-demo/src/main/java/com/amazonaws/services/neptune/GremlinClientDemo.java
30 3 0
constructor()
in amazon-neptune-and-aws-cdk-for-amundsen/lib/rds-stack.ts
29 2 3
void writeVertexCSV()
in gremlin/neptune-social-media-utils/src/main/java/com/aws/neptune/utils/generator/CSVGenerator.java
29 5 3
def clearGremlin()
in neptune-sagemaker/notebooks/util/neptune.py
26 7 6