facebookresearch / shaDow_GNN
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 279 units with 3,903 lines of code in units (51.8% of code).
    • 2 very long units (215 lines of code)
    • 9 long units (666 lines of code)
    • 48 medium size units (1,442 lines of code)
    • 50 small units (691 lines of code)
    • 170 very small units (889 lines of code)
5% | 17% | 36% | 17% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 14% | 36% | 19% | 25%
cpp16% | 28% | 37% | 10% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
shaDow4% | 12% | 34% | 22% | 26%
para_graph_sampler/graph_engine6% | 23% | 41% | 11% | 17%
scripts0% | 0% | 0% | 52% | 47%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def parse_n_prepare()
in shaDow/utils.py
111 31 5
void ParallelSampler::preproc_ppr_approximate()
in para_graph_sampler/graph_engine/backend/ParallelSampler.cpp
104 22 6
def main()
in shaDow/main.py
100 3 3
SubgraphStruct ParallelSampler::_node_induced_subgraph()
in para_graph_sampler/graph_engine/backend/ParallelSampler.cpp
98 22 5
bool ParallelSampler::read_PPR_from_binary_file()
in para_graph_sampler/graph_engine/backend/ParallelSampler.cpp
87 22 5
def _convert_ogb2shadow_link()
in para_graph_sampler/graph_engine/frontend/data_converter.py
83 4 3
def _convert_ogb2shadow_node()
in para_graph_sampler/graph_engine/frontend/data_converter.py
68 10 3
def postprocessing()
in shaDow/main.py
66 29 6
def _convert_saint2shadow()
in para_graph_sampler/graph_engine/frontend/data_converter.py
56 6 3
def instantiate_sampler()
in shaDow/minibatch.py
55 20 7
def one_batch()
in shaDow/minibatch.py
53 10 3
void ParallelSampler::write_PPR_to_binary_file()
in para_graph_sampler/graph_engine/backend/ParallelSampler.cpp
45 9 5
SubgraphStruct ParallelSampler::khop()
in para_graph_sampler/graph_engine/backend/ParallelSampler.cpp
45 10 3
def forward()
in shaDow/layers.py
45 13 4
std::vector ParallelSampler::parallel_sampler_ensemble()
in para_graph_sampler/graph_engine/backend/ParallelSampler.cpp
43 12 2
43 29 6
SubgraphStruct ParallelSampler::ppr_stochastic()
in para_graph_sampler/graph_engine/backend/ParallelSampler.cpp
42 9 3
def log_key_step()
in shaDow/logging_base.py
42 12 4
def _extract_subgraph_return()
in para_graph_sampler/graph_engine/frontend/samplers_ensemble.py
40 12 5
def cat_to_block_diagonal()
in para_graph_sampler/graph_engine/frontend/graph.py
39 12 2