tensorflow / model-card-toolkit
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 67 units with 788 lines of code in units (40.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 15 medium size units (410 lines of code)
    • 13 small units (180 lines of code)
    • 39 very small units (198 lines of code)
0% | 0% | 52% | 22% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 52% | 22% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
model_card_toolkit/utils0% | 0% | 62% | 19% | 18%
model_card_toolkit0% | 0% | 49% | 17% | 32%
model_card_toolkit/tfx0% | 0% | 28% | 38% | 33%
tools0% | 0% | 0% | 82% | 17%
ROOT0% | 0% | 0% | 60% | 40%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _update_from_v1_to_v2()
in model_card_toolkit/utils/json_util.py
48 23 2
def _extract_graph_data_from_dataset_feature_statistics()
in model_card_toolkit/utils/graphics.py
34 16 2
def export_format()
in model_card_toolkit/model_card_toolkit.py
33 6 5
def filter_metrics()
in model_card_toolkit/utils/tfx_util.py
33 10 3
def annotate_eval_result_metrics()
in model_card_toolkit/utils/tfx_util.py
32 12 2
def _annotate_eval_results()
in model_card_toolkit/model_card_toolkit.py
25 10 2
def annotate_eval_result_plots()
in model_card_toolkit/utils/graphics.py
25 12 2
def _draw_histogram()
in model_card_toolkit/utils/graphics.py
25 10 1
def _from_proto()
in model_card_toolkit/base_model_card_field.py
24 10 2
def _from_json()
in model_card_toolkit/base_model_card_field.py
24 9 4
def annotate_dataset_feature_statistics_plots()
in model_card_toolkit/utils/graphics.py
23 6 2
def _get_tfx_pipeline_types()
in model_card_toolkit/utils/tfx_util.py
21 5 1
def read_stats_proto()
in model_card_toolkit/utils/tfx_util.py
21 3 2
def to_proto()
in model_card_toolkit/base_model_card_field.py
21 8 1
def create_and_save_artifact()
in model_card_toolkit/tfx/artifact.py
21 3 3
def _annotate_dataset_statistics()
in model_card_toolkit/model_card_toolkit.py
19 8 2
def __post_init__()
in model_card_toolkit/utils/source.py
16 8 1
def __post_init__()
in model_card_toolkit/utils/source.py
16 8 1
def scaffold_assets()
in model_card_toolkit/model_card_toolkit.py
15 4 4
def __init__()
in model_card_toolkit/tfx/component.py
15 1 7