facebookresearch / fbpcf
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 73 units with 565 lines of code in units (46.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 6 medium size units (177 lines of code)
    • 13 small units (179 lines of code)
    • 54 very small units (209 lines of code)
0% | 0% | 31% | 31% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp0% | 0% | 48% | 26% | 24%
h0% | 0% | 9% | 38% | 52%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
fbpcf/aws0% | 0% | 96% | 0% | 3%
fbpcf/io0% | 0% | 27% | 39% | 32%
fbpcf/gcp0% | 0% | 100% | 0% | 0%
fbpcf/mpc0% | 0% | 17% | 14% | 68%
example/millionaire0% | 0% | 0% | 88% | 11%
fbpcf/perf0% | 0% | 0% | 100% | 0%
fbpcf/system0% | 0% | 0% | 51% | 48%
fbpcf/common0% | 0% | 0% | 40% | 60%
fbpcf/exception0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
std::unique_ptr createS3Client()
in fbpcf/aws/S3Util.cpp
40 15 1
34 5 1
std::string LocalFileManager::readBytes()
in fbpcf/io/LocalFileManager.cpp
30 4 3
29 5 1
std::pair test()
in fbpcf/mpc/EmpTestUtil.h
23 3 2
std::string S3FileManager::readBytes()
in fbpcf/io/S3FileManager.cpp
21 2 3
int main()
in example/millionaire/main.cpp
20 3 2
void wrapTestWithParty()
in fbpcf/mpc/EmpTestUtil.h
20 3 1
bool isDrngSupported()
in fbpcf/system/CpuUtil.cpp
15 5 0
std::string GCSFileManager::readBytes()
in fbpcf/io/GCSFileManager.h
14 2 3
void S3FileManager::write()
in fbpcf/io/S3FileManager.cpp
14 2 2
std::vector apply()
in fbpcf/common/VectorUtil.h
14 3 3
std::function decorate()
in fbpcf/perf/PerfUtil.h
13 1 2
bool play()
in example/millionaire/MillionaireGame.h
12 2 1
12 2 1
std::function decorate()
in fbpcf/perf/PerfUtil.h
12 1 2
void GCSFileManager::write()
in fbpcf/io/GCSFileManager.h
11 2 2
void LocalFileManager::write()
in fbpcf/io/LocalFileManager.cpp
11 2 2
std::unique_ptr getFileManager()
in fbpcf/io/FileManagerUtil.cpp
11 2 1
9 2 1