apple / turicreate
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 9,677 units with 123,353 lines of code in units (57.6% of code).
    • 4 very complex units (1,086 lines of code)
    • 47 complex units (6,274 lines of code)
    • 354 medium complex units (22,811 lines of code)
    • 719 simple units (23,297 lines of code)
    • 8,553 very simple units (69,885 lines of code)
<1% | 5% | 18% | 18% | 56%
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
cpp1% | 6% | 22% | 20% | 48%
py<1% | 1% | 15% | 20% | 61%
hpp0% | 4% | 15% | 15% | 65%
mm0% | 0% | 3% | 10% | 85%
h0% | 0% | 7% | 13% | 79%
js0% | 0% | 5% | 12% | 82%
c0% | 0% | 0% | 54% | 45%
pyx0% | 0% | 0% | 0% | 100%
swift0% | 0% | 0% | 0% | 100%
hh0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/toolkits1% | 6% | 23% | 21% | 48%
src/ml2% | 5% | 17% | 16% | 58%
src/core<1% | 5% | 15% | 18% | 60%
src/python<1% | 1% | 15% | 19% | 61%
src/visualization0% | 6% | 12% | 15% | 65%
src/model_server0% | 6% | 27% | 16% | 48%
src/capi0% | 0% | 5% | 1% | 93%
scripts0% | 0% | 0% | 64% | 35%
userguide/supervised-learning0% | 0% | 0% | 0% | 100%
src/deployment0% | 0% | 0% | 0% | 100%
src/unsupported_python0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
sframe recsys_model_base::recommend()
in src/toolkits/recsys/recsys_model_base.cpp
411 92 10
sframe make_random_sframe()
in src/core/storage/sframe_data/testing_utils.cpp
257 90 4
size_t fill_row_buffer_from_column_buffer()
in src/ml/ml_data/data_storage/ml_data_row_format.cpp
291 55 8
def groupby()
in src/python/turicreate/data_structures/sframe.py
127 52 4
void check_operation_feasibility()
in src/core/storage/sframe_interface/unity_sarray_binary_operations.cpp
59 49 3
void ml_data_side_features::add_and_index_side_data()
in src/toolkits/ml_data_2/side_features.cpp
246 48 6
def __init__()
in src/python/turicreate/data_structures/sframe.py
93 47 4
void ml_data::_fill_data_blocks()
in src/toolkits/ml_data_2/ml_data_setup.cpp
230 46 1
size_t fill_row_buffer_from_column_buffer()
in src/toolkits/ml_data_2/data_storage/ml_data_row_format.cpp
249 45 9
std::vector _all_shortest_paths()
in src/toolkits/graph_analytics/sssp_sgraph.cpp
181 44 4
std::shared_ptr unity_sarray::lazy_astype()
in src/core/storage/sframe_interface/unity_sarray.cpp
109 40 2
flex_type_enum get_output_type()
in src/core/storage/sframe_interface/unity_sarray_binary_operations.cpp
55 39 3
flexible_type option_info::interpret_value()
in src/model_server/lib/extensions/option_info.cpp
201 39 1
def __init__()
in src/python/turicreate/data_structures/sarray.py
80 39 5
bool csv_line_tokenizer::parse_as()
in src/core/storage/sframe_data/csv_line_tokenizer.cpp
94 38 6
void csv_writer::csv_print()
in src/core/storage/sframe_data/csv_writer.cpp
103 38 3
void recsys_model_base::setup_and_train()
in src/toolkits/recsys/recsys_model_base.cpp
194 38 4
bool csv_line_tokenizer::tokenize_line_impl()
in src/core/storage/sframe_data/csv_line_tokenizer.cpp
131 37 5
size_t typed_decode_stream::read()
in src/core/storage/sframe_data/sarray_v2_type_encoding.cpp
117 36 2
void brute_force_all_pairs_similarity_with_vector_reference()
in src/toolkits/sparse_similarity/neighbor_search.hpp
197 35 10