awslabs / sagemaker-document-understanding
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 55 units with 515 lines of code in units (31.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (57 lines of code)
    • 3 medium size units (77 lines of code)
    • 13 small units (181 lines of code)
    • 38 very small units (200 lines of code)
0% | 11% | 14% | 35% | 38%
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% | 14% | 35% | 38%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sagemaker_notebook_instance/containers/relationship_extraction0% | 20% | 27% | 18% | 34%
cloudformation/solution-assistant/src0% | 0% | 0% | 94% | 5%
sagemaker_notebook_instance/containers/summarization0% | 0% | 0% | 60% | 40%
sagemaker_notebook_instance/containers/question_answering0% | 0% | 0% | 36% | 63%
sagemaker_notebook_instance/containers/entity_recognition0% | 0% | 0% | 19% | 80%
sagemaker_notebook_instance/package/package0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train_fn()
in sagemaker_notebook_instance/containers/relationship_extraction/package/training.py
57 1 1
def parse_args()
in sagemaker_notebook_instance/containers/relationship_extraction/package/training.py
34 1 1
def model_fn()
in sagemaker_notebook_instance/containers/relationship_extraction/package/inference.py
22 1 1
def predict_fn()
in sagemaker_notebook_instance/containers/relationship_extraction/package/inference.py
21 1 2
def delete_sagemaker_endpoint_config()
in cloudformation/solution-assistant/src/lambda_function.py
18 3 1
def _validate()
in sagemaker_notebook_instance/containers/relationship_extraction/package/objects.py
16 2 1
def model_fn()
in sagemaker_notebook_instance/containers/question_answering/entry_point.py
16 1 1
def model_fn()
in sagemaker_notebook_instance/containers/summarization/entry_point.py
16 1 1
def delete_sagemaker_endpoint()
in cloudformation/solution-assistant/src/lambda_function.py
16 3 1
def on_delete()
in cloudformation/solution-assistant/src/lambda_function.py
14 2 2
def __init__()
in sagemaker_notebook_instance/containers/relationship_extraction/package/models.py
13 1 4
def delete_sagemaker_model()
in cloudformation/solution-assistant/src/lambda_function.py
13 3 1
def delete_s3_objects()
in cloudformation/solution-assistant/src/lambda_function.py
13 2 1
def training_step()
in sagemaker_notebook_instance/containers/relationship_extraction/package/models.py
12 1 3
def validation_step()
in sagemaker_notebook_instance/containers/relationship_extraction/package/models.py
12 1 3
def extract_entities()
in sagemaker_notebook_instance/containers/entity_recognition/entry_point.py
11 2 1
def predict_fn()
in sagemaker_notebook_instance/containers/summarization/entry_point.py
11 1 2
def extract_noun_chunks()
in sagemaker_notebook_instance/containers/entity_recognition/entry_point.py
10 2 1
def predict_fn()
in sagemaker_notebook_instance/containers/entity_recognition/entry_point.py
10 1 2
def predict_fn()
in sagemaker_notebook_instance/containers/question_answering/entry_point.py
10 1 2