facebookresearch / NeuralCompression
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 349 units with 2,561 lines of code in units (46.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (46 lines of code)
    • 7 simple units (174 lines of code)
    • 341 very simple units (2,341 lines of code)
0% | 0% | 1% | 6% | 91%
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
cc0% | 0% | 100% | 0% | 0%
py0% | 0% | 0% | 6% | 93%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
neuralcompression/ext0% | 0% | 88% | 0% | 11%
projects/deep_video_compression0% | 0% | 0% | 21% | 78%
projects/scale_hyperprior_lightning0% | 0% | 0% | 19% | 80%
neuralcompression/models0% | 0% | 0% | 3% | 96%
neuralcompression/functional0% | 0% | 0% | 6% | 93%
neuralcompression/entropy_coders0% | 0% | 0% | 0% | 100%
neuralcompression/layers0% | 0% | 0% | 0% | 100%
neuralcompression/data0% | 0% | 0% | 0% | 100%
projects/variational_image_compression0% | 0% | 0% | 0% | 100%
neuralcompression/distributions0% | 0% | 0% | 0% | 100%
neuralcompression/metrics0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
cc
std::vector pmf_to_quantized_cdf()
in neuralcompression/ext/pmf_to_quantized_cdf_py.cc
46 11 2
def training_step()
in projects/deep_video_compression/dvc_module.py
45 10 3
def collect_parameters()
in neuralcompression/models/scale_hyperprior.py
20 9 1
def log_images()
in projects/deep_video_compression/train.py
18 8 5
def run_training_stage()
in projects/deep_video_compression/train.py
34 7 7
def collect_parameters()
in projects/deep_video_compression/_utils.py
12 7 1
def main()
in projects/scale_hyperprior_lightning/train.py
30 7 1
def hsv_to_rgb()
in neuralcompression/functional/_hsv_to_rgb.py
15 7 1
def main()
in projects/deep_video_compression/train.py
21 5 1
def training_step()
in projects/scale_hyperprior_lightning/scale_hyperprior.py
24 5 4
def _update()
in neuralcompression/layers/_continuous_entropy.py
51 5 1
def _resize()
in neuralcompression/models/scale_hyperprior.py
13 5 2
def __getitem__()
in neuralcompression/data/_clic_2020_video.py
40 5 2
def validation_step()
in projects/deep_video_compression/dvc_module.py
27 4 3
def configure_optimizers()
in projects/deep_video_compression/dvc_module.py
25 4 1
def collect_parameters()
in projects/deep_video_compression/_utils.py
7 4 1
def forward()
in neuralcompression/models/_hific/_hific_generator.py
12 4 2
def forward()
in neuralcompression/models/deep_video_compression.py
10 4 2
def __getitem__()
in neuralcompression/data/_vimeo_90k_septuplet.py
15 4 2
def download()
in neuralcompression/data/_clic_2020_image.py
15 4 1