tensorflow / federated
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 2,415 units with 25,450 lines of code in units (63.7% of code).
    • 6 very long units (742 lines of code)
    • 49 long units (3,216 lines of code)
    • 262 medium size units (8,007 lines of code)
    • 406 small units (6,090 lines of code)
    • 1,692 very small units (7,395 lines of code)
2% | 12% | 31% | 23% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py2% | 13% | 30% | 24% | 28%
cc4% | 10% | 43% | 23% | 18%
h0% | 0% | 4% | 23% | 71%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_federated/python/core4% | 13% | 31% | 20% | 30%
tensorflow_federated/cc/core3% | 7% | 35% | 23% | 30%
tensorflow_federated/python/aggregators5% | 13% | 35% | 22% | 22%
tensorflow_federated/python/learning0% | 19% | 30% | 23% | 26%
tensorflow_federated/python/simulation0% | 8% | 32% | 32% | 26%
tensorflow_federated/python/common_libs0% | 23% | 14% | 18% | 43%
tensorflow_federated/python/analytics0% | 9% | 31% | 34% | 23%
tensorflow_federated/python/tensorflow_libs0% | 0% | 28% | 27% | 43%
tensorflow_federated/experimental/python0% | 0% | 57% | 11% | 31%
tensorflow_federated/python/program0% | 0% | 10% | 52% | 36%
tensorflow_federated/tools/runtime0% | 0% | 100% | 0% | 0%
tensorflow_federated/tools0% | 0% | 0% | 100% | 0%
tensorflow_federated/tools/client0% | 0% | 0% | 0% | 100%
tensorflow_federated/tools/python_package0% | 0% | 0% | 0% | 100%
tensorflow_federated/cc/common_libs0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _structural_representation()
in tensorflow_federated/python/core/impl/compiler/building_blocks.py
205 46 1
def __init__()
in tensorflow_federated/python/core/backends/mapreduce/forms.py
111 9 14
def strip_placement()
in tensorflow_federated/python/core/impl/compiler/tree_transformations.py
109 8 1
absl::StatusOr CallFederatedIntrinsic()
in tensorflow_federated/cc/core/impl/executors/federating_executor.cc
109 17 2
def _encoded_next_fn()
in tensorflow_federated/python/aggregators/encoded.py
104 4 3
def transform_postorder_with_symbol_bindings()
in tensorflow_federated/python/core/impl/compiler/transformation_utils.py
104 32 3
def _make_wrapper()
in tensorflow_federated/python/aggregators/robust.py
94 4 7
def embed_tensorflow_computation()
in tensorflow_federated/python/core/impl/executors/eager_tf_executor.py
91 23 3
def client_update()
in tensorflow_federated/python/learning/reconstruction/training_process.py
91 15 2
def save_functional_model()
in tensorflow_federated/python/learning/models/serialization.py
91 16 2
def _build_tf_computations_for_gather()
in tensorflow_federated/python/learning/framework/encoding_utils.py
87 4 3
def check_concrete_instance_of()
in tensorflow_federated/python/core/impl/types/type_analysis.py
86 29 2
def create_synthetic_data_dictionary()
in tensorflow_federated/python/simulation/datasets/stackoverflow.py
84 1 0
def type_to_py_container()
in tensorflow_federated/python/core/impl/types/type_conversions.py
81 24 2
def infer_type()
in tensorflow_federated/python/core/impl/types/type_conversions.py
80 34 1
def _string_representation()
in tensorflow_federated/python/core/impl/types/computation_types.py
79 24 2
def __init__()
in tensorflow_federated/python/core/impl/execution_contexts/mergeable_comp_execution_context.py
78 7 5
def create_hierarchical_histogram_aggregation_factory()
in tensorflow_federated/python/analytics/hierarchical_histogram/hierarchical_histogram_factory.py
77 21 8
def save()
in tensorflow_federated/python/learning/models/serialization.py
74 7 3
absl::StatusOr CallIntrinsicAggregate()
in tensorflow_federated/cc/core/impl/executors/composing_executor.cc
71 9 1