facebookresearch / calibration_membership
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 88 units with 1,840 lines of code in units (89.3% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (373 lines of code)
    • 9 medium complex units (468 lines of code)
    • 9 simple units (255 lines of code)
    • 67 very simple units (744 lines of code)
0% | 20% | 25% | 13% | 40%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 20% | 25% | 13% | 40%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
attacks0% | 24% | 42% | 11% | 21%
datasets0% | 65% | 11% | 0% | 23%
training0% | 0% | 48% | 11% | 40%
utils0% | 0% | 0% | 22% | 77%
models0% | 0% | 0% | 30% | 69%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_dataset()
in datasets/__init__.py
173 35 4
def get_calibrated_gradnorm()
in attacks/privacy_attacks.py
87 29 9
def auxiliary_attack()
in attacks/privacy_attacks.py
113 28 8
def get_confidences()
in attacks/privacy_attacks.py
79 21 1
def get_dataset()
in attacks/privacy_attacks.py
90 18 1
def init_distributed_mode()
in training/image_classification.py
61 15 1
def get_transform()
in datasets/__init__.py
31 15 3
def get_parser()
in attacks/privacy_attacks.py
42 15 0
def get_calibrated_losses()
in attacks/privacy_attacks.py
43 15 6
def get_uncalibrated_gradnorm()
in attacks/privacy_attacks.py
48 13 2
def get_calibrated_confidences()
in attacks/privacy_attacks.py
41 12 6
def train()
in training/image_classification.py
33 11 2
def build_model()
in models/__init__.py
43 10 1
def main()
in training/language_modeling.py
22 9 1
def create_privacy_engine()
in utils/optimizer.py
28 9 3
def get_losses()
in attacks/privacy_attacks.py
45 8 1
def get_calibrated_distances()
in attacks/privacy_attacks.py
26 7 4
def generate_masks()
in utils/masks.py
34 6 2
def print_stats()
in utils/trainer.py
17 6 1
def eval_classif()
in utils/evaluator.py
16 6 3