tensorflow / gnn
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 444 units with 4,334 lines of code in units (76.5% of code).
    • 0 very long units (0 lines of code)
    • 9 long units (582 lines of code)
    • 40 medium size units (1,145 lines of code)
    • 85 small units (1,221 lines of code)
    • 310 very small units (1,386 lines of code)
0% | 13% | 26% | 28% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 13% | 26% | 28% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_gnn/graph0% | 14% | 23% | 33% | 29%
tensorflow_gnn/graph/keras0% | 11% | 38% | 19% | 30%
tensorflow_gnn/sampler0% | 63% | 0% | 0% | 36%
tensorflow_gnn/tools0% | 0% | 29% | 28% | 41%
tensorflow_gnn/data0% | 0% | 12% | 29% | 57%
ROOT0% | 0% | 0% | 26% | 73%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def pad_to_total_sizes()
in tensorflow_gnn/graph/padding_ops.py
86 9 5
def _satisfies_total_sizes_internal()
in tensorflow_gnn/graph/padding_ops.py
70 11 5
def call()
in tensorflow_gnn/graph/keras/layers/gat_v2.py
69 19 7
def dynamic_batch()
in tensorflow_gnn/graph/batching_utils.py
69 11 2
def __init__()
in tensorflow_gnn/graph/keras/layers/gat_v2.py
65 14 20
def random_graph_tensor()
in tensorflow_gnn/graph/graph_tensor_random.py
60 7 5
def encode_subgraph_to_example()
in tensorflow_gnn/sampler/subgraph.py
60 21 2
def _validate_indices()
in tensorflow_gnn/graph/adjacency.py
52 14 1
def get_io_spec()
in tensorflow_gnn/graph/graph_tensor_io.py
51 12 3
def fill()
in tensorflow_gnn/graph/tensor_utils.py
49 14 3
def _check_size_fields()
in tensorflow_gnn/graph/graph_tensor_io.py
48 8 2
def random_ragged_tensor()
in tensorflow_gnn/graph/graph_tensor_random.py
47 13 8
def _create_empty_value()
in tensorflow_gnn/graph/graph_piece.py
46 13 1
def check_required_features()
in tensorflow_gnn/graph/schema_validation.py
41 13 2
def pad_to_nrows()
in tensorflow_gnn/graph/tensor_utils.py
35 6 4
def call()
in tensorflow_gnn/graph/keras/layers/map_features.py
34 9 2
def _from_data()
in tensorflow_gnn/graph/graph_piece.py
33 6 5
def call()
in tensorflow_gnn/graph/keras/layers/next_state.py
32 5 4
def softmax()
in tensorflow_gnn/graph/normalization_ops.py
31 5 7
def _convolve()
in tensorflow_gnn/graph/keras/layers/gat_v2.py
31 7 15