apple / turicreate
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 9,677 units with 123,353 lines of code in units (57.6% of code).
    • 100 very long units (15,021 lines of code)
    • 304 long units (20,830 lines of code)
    • 1,138 medium size units (35,035 lines of code)
    • 1,576 small units (22,929 lines of code)
    • 6,559 very small units (29,538 lines of code)
12% | 16% | 28% | 18% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp15% | 22% | 30% | 16% | 14%
hpp7% | 10% | 21% | 18% | 41%
py9% | 10% | 27% | 23% | 28%
mm4% | 4% | 45% | 25% | 19%
h0% | 17% | 11% | 26% | 44%
js0% | 5% | 46% | 29% | 19%
swift0% | 50% | 0% | 23% | 25%
c0% | 0% | 54% | 41% | 4%
pyx0% | 0% | 0% | 24% | 75%
hh0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/toolkits18% | 24% | 30% | 13% | 12%
src/core7% | 13% | 26% | 20% | 31%
src/python9% | 10% | 27% | 23% | 29%
src/ml11% | 17% | 29% | 20% | 21%
src/model_server14% | 19% | 24% | 17% | 24%
src/visualization9% | 10% | 37% | 21% | 20%
src/capi0% | 5% | 9% | 19% | 64%
userguide/supervised-learning0% | 0% | 32% | 41% | 26%
scripts0% | 0% | 43% | 37% | 19%
src/deployment0% | 0% | 0% | 43% | 56%
src/unsupported_python0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void define_resnet()
in src/toolkits/style_transfer/style_transfer_model_definition.cpp
799 2 4
def stop_words()
in src/python/turicreate/toolkits/text_analytics/_util.py
532 3 1
sframe recsys_model_base::recommend()
in src/toolkits/recsys/recsys_model_base.cpp
411 92 10
size_t fill_row_buffer_from_column_buffer()
in src/ml/ml_data/data_storage/ml_data_row_format.cpp
291 55 8
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/toolkits/ml_data_2/data_storage/ml_data_row_format.cpp
249 45 9
void ml_data_side_features::add_and_index_side_data()
in src/toolkits/ml_data_2/side_features.cpp
246 48 6
void ml_data::_fill_data_blocks()
in src/toolkits/ml_data_2/ml_data_setup.cpp
230 46 1
void sgraph::commit_edge_buffer()
in src/core/storage/sgraph_data/sgraph.cpp
227 19 3
void ball_tree_neighbors::train()
in src/toolkits/nearest_neighbors/ball_tree_neighbors.cpp
209 28 4
flexible_type option_info::interpret_value()
in src/model_server/lib/extensions/option_info.cpp
201 39 1
void brute_force_all_pairs_similarity_with_vector_reference()
in src/toolkits/sparse_similarity/neighbor_search.hpp
197 35 10
void recsys_model_base::setup_and_train()
in src/toolkits/recsys/recsys_model_base.cpp
194 38 4
void handle_request()
in src/visualization/server/server.cpp
186 27 4
void run()
in src/toolkits/graph_analytics/label_propagation.cpp
184 32 3
std::vector _all_shortest_paths()
in src/toolkits/graph_analytics/sssp_sgraph.cpp
181 44 4
sframe sgraph::get_edges()
in src/core/storage/sgraph_data/sgraph.cpp
172 24 5
void define_vgg()
in src/toolkits/style_transfer/style_transfer_model_definition.cpp
169 1 1
void ml_data::_fill_data_blocks()
in src/ml/ml_data/ml_data.cpp
167 26 6
inline ls_return more_thuente()
in src/ml/optimization/line_search-inl.hpp
163 29 9