fbsamples / fbctf-2019-challenges
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 767 units with 9,524 lines of code in units (58.2% of code).
    • 1 very long units (155 lines of code)
    • 21 long units (1,433 lines of code)
    • 98 medium size units (3,027 lines of code)
    • 158 small units (2,284 lines of code)
    • 489 very small units (2,625 lines of code)
1% | 15% | 31% | 23% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go8% | 15% | 35% | 22% | 18%
c0% | 24% | 42% | 15% | 16%
cpp0% | 35% | 26% | 17% | 19%
cc0% | 31% | 22% | 21% | 24%
py0% | 2% | 22% | 31% | 43%
rs0% | 0% | 37% | 33% | 28%
h0% | 0% | 45% | 0% | 54%
php0% | 0% | 0% | 95% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
misc/homework_assignment_133710% | 8% | 34% | 23% | 23%
reversing/SOMBRERO_ROJO0% | 60% | 23% | 12% | 3%
reversing/matryoshka0% | 40% | 8% | 36% | 14%
misc/j0hnny_50% | 38% | 43% | 14% | 4%
misc/osquery_game0% | 33% | 40% | 13% | 12%
reversing/nomoreseacrypts0% | 35% | 12% | 29% | 22%
pwnables/raddest_db0% | 23% | 16% | 24% | 35%
pwnables/kpets0% | 21% | 50% | 4% | 24%
pwnables/asciishop0% | 0% | 52% | 18% | 28%
web/secret_note_keeper0% | 0% | 53% | 20% | 26%
crypto/keybaseish0% | 0% | 41% | 29% | 28%
crypto/storagespace0% | 0% | 24% | 41% | 33%
crypto/frank0% | 0% | 14% | 18% | 66%
crypto/netscream0% | 0% | 34% | 43% | 21%
web/events0% | 0% | 63% | 14% | 22%
misc/whysapp0% | 0% | 56% | 12% | 31%
pwnables/overfloat0% | 0% | 77% | 0% | 22%
pwnables/rusty_shop0% | 0% | 37% | 33% | 28%
pwnables/babylist0% | 0% | 19% | 29% | 50%
pwnables/otp_server0% | 0% | 12% | 24% | 63%
web/pdfme0% | 0% | 46% | 36% | 17%
pwnables/rank0% | 0% | 28% | 0% | 71%
crypto/postquantumsig0% | 0% | 0% | 40% | 59%
web/products-manager0% | 0% | 0% | 95% | 4%
reversing/go_get_the_flag0% | 0% | 0% | 80% | 19%
misc/evil0% | 0% | 0% | 32% | 67%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in misc/homework_assignment_1337/src/gen-go/ping/ping_bot-remote/ping_bot-remote.go
155 29 0
cc
void eval()
in pwnables/raddest_db/raddest_db.cc
100 31 1
int main()
in reversing/matryoshka/src/gen_downloader.c
92 11 2
int main()
in reversing/nomoreseacrypts/src/main.cpp
92 9 0
QueryData generate()
in misc/osquery_game/challenge.cpp
91 27 1
def main()
in reversing/matryoshka/generate.py
85 9 0
void __attribute__()
in reversing/SOMBRERO_ROJO/ctf_main/main.c
80 10 1
int get_appended()
in reversing/SOMBRERO_ROJO/ctf_main/main.c
76 6 2
int decrypt_file_ctf()
in reversing/SOMBRERO_ROJO/crypto/rc4block.c
69 7 3
int encrypt_file_ctf()
in reversing/SOMBRERO_ROJO/crypto/rc4block.c
65 8 4
int encrypt_file()
in reversing/SOMBRERO_ROJO/crypto/rc4block.c
65 8 3
func main()
in misc/homework_assignment_1337/src/main.go
63 15 0
func process_double()
in misc/j0hnny_5/server.go
62 20 3
std::set getDstPositions()
in misc/osquery_game/challenge.cpp
62 24 1
static ssize_t dev_write()
in pwnables/kpets/src/kpets.c
58 10 4
func()
in misc/homework_assignment_1337/src/gen-go/ping/ping.go
57 20 1
func process_single()
in misc/j0hnny_5/server.go
54 17 3
void main()
in reversing/SOMBRERO_ROJO/flag/flag_main.c
54 1 0
int decrypt_file()
in reversing/SOMBRERO_ROJO/crypto/rc4block.c
53 7 2
static void KeyExpansion()
in reversing/nomoreseacrypts/src/aes.c
53 5 3