facebookresearch / hanabi_SAD
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 215 units with 2,538 lines of code in units (63.8% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (171 lines of code)
    • 30 medium size units (1,006 lines of code)
    • 44 small units (645 lines of code)
    • 138 very small units (716 lines of code)
0% | 6% | 39% | 25% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h0% | 10% | 30% | 22% | 35%
cc0% | 22% | 52% | 21% | 3%
py0% | 0% | 43% | 28% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
rela0% | 10% | 32% | 26% | 30%
cpp0% | 25% | 47% | 5% | 20%
pyhanabi0% | 0% | 56% | 25% | 17%
pyhanabi/tools0% | 0% | 48% | 35% | 15%
pyhanabi/common_utils0% | 0% | 11% | 27% | 61%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
66 10 1
SampleWeightIds sample_()
in rela/prioritized_replay.h
53 8 2
virtual void postAct()
in rela/r2d2_actor.h
52 10 2
cc
std::tuple HanabiEnv::step()
in cpp/hanabi_env.cc
50 10 1
def parse_args()
in pyhanabi/selfplay.py
47 1 0
def create_dataset()
in pyhanabi/tools/action_matrix.py
46 5 3
def act()
in pyhanabi/r2d2.py
46 3 3
def load_op_model()
in pyhanabi/utils.py
45 10 4
FFTransition popTransition()
in rela/transition_buffer.h
39 8 0
def evaluate()
in pyhanabi/eval.py
39 13 10
void mainLoop()
in cpp/thread_loop.h
38 10 0
def load_agent()
in pyhanabi/utils.py
38 5 2
def __init__()
in pyhanabi/tools/obl_model.py
37 5 6
def save()
in pyhanabi/common_utils/saver.py
36 14 6
def loss()
in pyhanabi/r2d2.py
36 3 4
35 3 2
35 3 2
34 8 0
def td_error()
in pyhanabi/r2d2.py
33 3 9
def log_explore_ratio()
in pyhanabi/utils.py
32 8 2