tensorflow / swift-models
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 656 units with 9,233 lines of code in units (32.2% of code).
    • 2 very complex units (324 lines of code)
    • 12 complex units (1,029 lines of code)
    • 25 medium complex units (1,143 lines of code)
    • 58 simple units (1,385 lines of code)
    • 559 very simple units (5,352 lines of code)
3% | 11% | 12% | 15% | 57%
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
h8% | 13% | 19% | 19% | 38%
swift0% | 9% | 7% | 11% | 72%
py0% | 0% | 0% | 46% | 53%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Support7% | 12% | 17% | 18% | 43%
TensorBoard0% | 24% | 21% | 17% | 36%
Models0% | 20% | 0% | 9% | 69%
Datasets0% | 14% | 15% | 10% | 59%
Checkpoints0% | 7% | 11% | 7% | 72%
PersonLab0% | 0% | 8% | 23% | 68%
Gym0% | 0% | 3% | 0% | 96%
MiniGo0% | 0% | 0% | 35% | 64%
SwiftModelsBenchmarks0% | 0% | 0% | 46% | 53%
FastStyleTransfer0% | 0% | 0% | 35% | 64%
SwiftModelsBenchmarksCore0% | 0% | 0% | 0% | 100%
pix2pix0% | 0% | 0% | 0% | 100%
TrainingLoop0% | 0% | 0% | 0% | 100%
Catch0% | 0% | 0% | 0% | 100%
ImageLoader0% | 0% | 0% | 0% | 100%
GAN0% | 0% | 0% | 0% | 100%
Autoencoder0% | 0% | 0% | 0% | 100%
DCGAN0% | 0% | 0% | 0% | 100%
CycleGAN0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
static int stbi__parse_png_file()
in Support/STBImage/include/stb_image.h
154 84 3
static int stbi__create_png_image_raw()
in Support/STBImage/include/stb_image.h
170 57 8
init?()
in Checkpoints/Protobufs/types.pb.swift
52 48 1
init?()
in TensorBoard/Protobufs/types.pb.swift
46 42 1
mutating func decodeMessage()
in Models/Text/SentencePiece/SentencePieceModel.pb.swift
47 38 1
static int stbi__process_marker()
in Support/STBImage/include/stb_image.h
92 37 2
func traverse()
in Models/Text/SentencePiece/SentencePieceModel.pb.swift
111 36 1
static int stbi__parse_entropy_coded_data()
in Support/STBImage/include/stb_image.h
101 36 1
static int stbi_write_jpg_core()
in Support/STBImage/include/stb_image_write.h
184 34 6
mutating func decodeMessage()
in TensorBoard/Protobufs/event.pb.swift
63 33 1
mutating func decodeMessage()
in TensorBoard/Protobufs/summary.pb.swift
61 31 1
static int stbi__jpeg_decode_block_prog_ac()
in Support/STBImage/include/stb_image.h
106 30 4
init()
in Datasets/COCO/COCO.swift
104 28 3
static int stbi__process_frame_header()
in Support/STBImage/include/stb_image.h
62 27 2
static int stbi__tga_info()
in Support/STBImage/include/stb_image.h
62 24 4
static int stbi__tga_test()
in Support/STBImage/include/stb_image.h
28 24 1
static void stbiw__encode_png_line()
in Support/STBImage/include/stb_image_write.h
32 24 8
static void stbiw__write_hdr_scanline()
in Support/STBImage/include/stb_image_write.h
75 21 5
static int stbi_write_tga_core()
in Support/STBImage/include/stb_image_write.h
70 20 5
static int stbi__process_scan_header()
in Support/STBImage/include/stb_image.h
36 19 1