facebookresearch / Hanabi_SPARTA
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 507 units with 6,173 lines of code in units (67.6% of code).
    • 1 very long units (117 lines of code)
    • 14 long units (916 lines of code)
    • 75 medium size units (2,220 lines of code)
    • 103 small units (1,425 lines of code)
    • 314 very small units (1,495 lines of code)
1% | 14% | 35% | 23% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc2% | 15% | 35% | 25% | 21%
h0% | 9% | 36% | 16% | 37%
js0% | 13% | 35% | 9% | 41%
py0% | 0% | 80% | 14% | 5%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
csrc2% | 15% | 35% | 24% | 23%
webapp/src/components0% | 31% | 24% | 0% | 44%
webapp/src0% | 0% | 44% | 16% | 38%
ROOT0% | 0% | 100% | 0% | 0%
webapp0% | 0% | 59% | 29% | 10%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
cc
Move SearchBot::doSearch_()
in csrc/SearchBot.cc
117 31 11
cc
void pleaseMakeMove()
in csrc/InfoBot.cc
85 24 1
84 20 1
cc
void CardKnowledge::update()
in csrc/HolmesBot.cc
84 45 2
cc
void JointSearchBot::updateFrames_()
in csrc/JointSearchBot.cc
80 13 2
72 23 1
cc
void get_hint()
in csrc/InfoBot.cc
70 14 1
64 19 6
62 25 2
56 12 3
54 15 2
52 23 3
cc
void Server::pleasePlay()
in csrc/HanabiServer.cc
51 11 1
51 20 5
function RevealOwnHand()
in webapp/src/components/RevealOwnHand.js
51 1 0
cc
int Server::runGame()
in csrc/HanabiServer.cc
47 9 2
void batchForward()
in csrc/AsyncModelWrapper.h
45 8 0
cc
void Server::pleaseGiveValueHint()
in csrc/HanabiServer.cc
45 12 2
cc
void Server::pleaseGiveColorHint()
in csrc/HanabiServer.cc
44 11 2
44 8 3