facebookresearch / torcharrow
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 1,878 units with 6,925 lines of code in units (64.3% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (35 lines of code)
    • 15 medium complex units (475 lines of code)
    • 41 simple units (939 lines of code)
    • 1,821 very simple units (5,476 lines of code)
0% | <1% | 6% | 13% | 79%
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% | <1% | 9% | 15% | 73%
cpp0% | 0% | 7% | 25% | 66%
h0% | 0% | 0% | 9% | 90%
pyi0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
torcharrow0% | 1% | 15% | 16% | 66%
torcharrow/velox_rt0% | 0% | 5% | 16% | 77%
csrc/velox0% | 0% | 2% | 7% | 90%
ROOT0% | 0% | 41% | 0% | 58%
csrc/velox/functions0% | 0% | 0% | 22% | 77%
torcharrow/benchmark0% | 0% | 0% | 0% | 100%
tutorial0% | 0% | 0% | 0% | 100%
tools/codegen0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def common_dtype()
in torcharrow/dtypes.py
35 27 2
def dtype_of_type()
in torcharrow/dtypes.py
46 23 2
def select()
in torcharrow/velox_rt/dataframe_cpu.py
49 21 3
def __getitem__()
in torcharrow/icolumn.py
33 19 2
def _py_arithmetic_op()
in torcharrow/icolumn.py
35 18 4
def __str__()
in torcharrow/expression.py
35 16 1
std::string opCodeToFunctionName()
in csrc/velox/column.cpp
48 14 1
def traceproperty()
in torcharrow/trace.py
6 14 1
def infer_dtype_from_value()
in torcharrow/dtypes.py
32 14 1
def get_velox_type()
in torcharrow/velox_rt/typing.py
32 14 1
def dtype_of_velox_type()
in torcharrow/dtypes.py
41 13 1
def _normalize_agg_arg()
in torcharrow/velox_rt/dataframe_cpu.py
21 13 2
28 12 2
def typeof_np_dtype()
in torcharrow/dtypes.py
22 11 1
def _str()
in torcharrow/expression.py
20 11 1
def _if_else()
in torcharrow/velox_rt/numerical_column_cpu.py
27 11 3
if constexpr()
in csrc/velox/lib.cpp
41 10 1
def __post_init__()
in torcharrow/dtypes.py
26 10 1
def _arrowtype_to_dtype()
in torcharrow/_interop.py
18 10 2
def __rtruediv__()
in torcharrow/velox_rt/numerical_column_cpu.py
25 10 2