facebookresearch / dachshund
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 245 units with 2,507 lines of code in units (49.6% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (360 lines of code)
    • 27 medium size units (866 lines of code)
    • 40 small units (613 lines of code)
    • 173 very small units (668 lines of code)
0% | 14% | 34% | 24% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs0% | 14% | 34% | 24% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/dachshund/algorithms0% | 22% | 48% | 21% | 7%
src/dachshund0% | 9% | 25% | 26% | 38%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn iterate_cnm_communities()
in src/dachshund/algorithms/cnm_communities.rs
89 6 2
fn one_step_search()
in src/dachshund/beam.rs
82 15 3
fn _get_k_trusses()
in src/dachshund/algorithms/coreness.rs
70 14 3
fn get_line_processor()
in src/dachshund/transformer_base.rs
62 9 1
fn init_cnm_communities()
in src/dachshund/algorithms/cnm_communities.rs
57 6 1
fn _get_connected_components_membership()
in src/dachshund/algorithms/connected_components.rs
50 18 3
fn get_shortest_paths()
in src/dachshund/algorithms/shortest_paths.rs
46 11 3
fn process_line()
in src/dachshund/typed_graph_line_processor.rs
43 3 2
fn get_coreness_values()
in src/dachshund/algorithms/coreness.rs
42 6 1
fn compute_graph_stats_json()
in src/dachshund/simple_transformer.rs
41 1 1
fn get_brokerage_scores_for_node()
in src/dachshund/algorithms/brokerage.rs
41 13 3
fn populate_edges()
in src/dachshund/typed_graph_builder.rs
41 3 2
fn get_strongly_connected_components()
in src/dachshund/algorithms/connected_components.rs
39 6 1
fn get_shortest_paths_bfs()
in src/dachshund/algorithms/shortest_paths.rs
38 8 2
fn pre_process_rows()
in src/dachshund/typed_graph_builder.rs
32 6 2
fn get_node_betweenness_starting_from_sources()
in src/dachshund/algorithms/betweenness.rs
30 9 4
fn get_node_betweenness_brandes()
in src/dachshund/algorithms/betweenness.rs
30 9 1
fn enumerate_shortest_paths()
in src/dachshund/algorithms/shortest_paths.rs
29 5 4
fn trim_edges()
in src/dachshund/typed_graph_builder.rs
29 9 2
fn process_batch()
in src/dachshund/core_transformer.rs
29 2 4