facebookresearch / hiplot
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 332 units with 4,015 lines of code in units (62.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (73 lines of code)
    • 8 medium complex units (454 lines of code)
    • 26 simple units (682 lines of code)
    • 297 very simple units (2,806 lines of code)
0% | 1% | 11% | 16% | 69%
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
tsx0% | 3% | 9% | 15% | 71%
py0% | 0% | 17% | 10% | 72%
ts0% | 0% | 9% | 27% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/parallel0% | 12% | 20% | 13% | 53%
src0% | 0% | 10% | 24% | 64%
hiplot0% | 0% | 17% | 10% | 72%
src/distribution0% | 0% | 6% | 33% | 60%
src/lib0% | 0% | 0% | 11% | 88%
src/tutorial0% | 0% | 0% | 0% | 100%
src/streamlit0% | 0% | 0% | 0% | 100%
src/dataproviders0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
componentDidUpdate()
in src/parallel/parallel.tsx
73 27 2
function brush()
in src/parallel/parallel.tsx
120 21 0
def load_fairseq()
in hiplot/fetchers.py
51 19 1
function infertype()
in src/infertypes.ts
41 18 2
mountDt()
in src/rowsdisplaytable.tsx
92 16 0
def html_inlinize()
in hiplot/render.py
41 14 2
def demo()
in hiplot/fetchers_demo.py
61 13 1
componentDidUpdate()
in src/distribution/plot.tsx
18 12 2
export function colorScheme()
in src/infertypes.ts
30 12 4
function render_dp()
in src/plotxy.tsx
31 10 3
function ticks()
in src/lib/d3_scales.ts
29 10 1
37 10 3
def validate()
in hiplot/experiment.py
20 9 1
def from_dataframe()
in hiplot/experiment.py
11 9 1
def from_optuna()
in hiplot/experiment.py
18 9 1
function filter_range()
in src/filters.ts
27 9 1
var scale: any = function()
in src/lib/d3_scales.ts
27 9 1
var addValue = function()
in src/infertypes.ts
16 9 1
def load_json()
in hiplot/fetchers.py
16 8 1
50 8 0