tensorflow / model-remediation
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 77 units with 965 lines of code in units (78.5% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (262 lines of code)
    • 8 medium size units (251 lines of code)
    • 12 small units (191 lines of code)
    • 53 very small units (261 lines of code)
0% | 27% | 26% | 19% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 27% | 26% | 19% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_model_remediation/min_diff/keras/utils0% | 53% | 23% | 11% | 11%
tensorflow_model_remediation/tools/tutorials_utils/uci0% | 57% | 0% | 20% | 21%
tensorflow_model_remediation/min_diff/keras/models0% | 23% | 38% | 12% | 25%
tensorflow_model_remediation/min_diff/losses0% | 0% | 31% | 25% | 43%
tensorflow_model_remediation/tools0% | 0% | 92% | 0% | 7%
tensorflow_model_remediation/tools/tutorials_utils0% | 0% | 0% | 92% | 7%
tensorflow_model_remediation/min_diff/losses/kernels0% | 0% | 0% | 28% | 71%
tensorflow_model_remediation/common0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_uci_model()
in tensorflow_model_remediation/tools/tutorials_utils/uci/utils.py
77 9 1
def build_min_diff_dataset()
in tensorflow_model_remediation/min_diff/keras/utils/input_utils.py
75 13 2
def pack_min_diff_data()
in tensorflow_model_remediation/min_diff/keras/utils/input_utils.py
55 18 4
def __init__()
in tensorflow_model_remediation/min_diff/keras/models/min_diff_model.py
55 15 6
def __call__()
in tensorflow_model_remediation/min_diff/losses/base_loss.py
42 7 4
def execute()
in tensorflow_model_remediation/tools/build_api_docs.py
37 7 4
def _compute_single_min_diff_loss()
in tensorflow_model_remediation/min_diff/keras/models/min_diff_model.py
35 4 7
def _conform_weights_to_losses()
in tensorflow_model_remediation/min_diff/keras/models/min_diff_model.py
34 20 3
def _assert_same_min_diff_structure()
in tensorflow_model_remediation/min_diff/keras/utils/structure_utils.py
32 7 2
def validate_min_diff_structure()
in tensorflow_model_remediation/min_diff/keras/utils/structure_utils.py
25 10 3
def call()
in tensorflow_model_remediation/min_diff/losses/absolute_correlation_loss.py
25 1 4
def get_config()
in tensorflow_model_remediation/min_diff/keras/models/min_diff_model.py
21 9 1
def _calculate_mean()
in tensorflow_model_remediation/min_diff/losses/mmd_loss.py
20 1 5
def create_keras_sequential_model()
in tensorflow_model_remediation/tools/tutorials_utils/min_diff_keras_utils.py
20 3 10
def _pack_min_diff_sequence_as()
in tensorflow_model_remediation/min_diff/keras/utils/structure_utils.py
18 6 2
def __init__()
in tensorflow_model_remediation/min_diff/losses/base_loss.py
17 2 6
def download_and_process_civil_comments_data()
in tensorflow_model_remediation/tools/tutorials_utils/min_diff_keras_utils.py
17 1 0
def get_uci_min_diff_datasets()
in tensorflow_model_remediation/tools/tutorials_utils/uci/utils.py
17 1 4
def compute_min_diff_loss()
in tensorflow_model_remediation/min_diff/keras/models/min_diff_model.py
16 5 4
def _get_kernel()
in tensorflow_model_remediation/min_diff/losses/kernels/kernel_utils.py
16 5 3