File Complexity Overall
  • There are 624 files with units, with 88,051 lines of code.
    • 3 very complex files (McCabe index sum 251+; 5,282 lines of code)
    • 19 complex files (McCabe index sum 126-250; 18,547 lines of code)
    • 32 medium complex files (McCabe index sum 51-125; 12,460 lines of code)
    • 73 slightly complex files (McCabe index sum 26-50; 17,363 lines of code)
    • 497 simple files (McCabe index sum 1-25; 34,399 lines of code)
  • 290 main files have no units (e.g. languages without unit analysis, or files without functions) and are not classified.
system5% | 21% | 14% | 19% | 39%
Legend:
251+
126-250
51-125
26-50
1-25


explore: grouped by folders | grouped by complexity
File Complexity per Extension
251+
126-250
51-125
26-50
1-25
h9% | 20% | 13% | 9% | 46%
cc5% | 19% | 16% | 22% | 36%
hpp0% | 100% | 0% | 0% | 0%
c0% | 100% | 0% | 0% | 0%
py0% | 0% | 45% | 22% | 31%
rs0% | 0% | 0% | 54% | 45%
cpp0% | 0% | 0% | 64% | 35%
File Complexity per Logical Decomposition
primary
251+
126-250
51-125
26-50
1-25
src6% | 21% | 12% | 19% | 39%
benchmarks0% | 0% | 59% | 40% | 0%
deploy0% | 0% | 70% | 0% | 29%
hf3fs0% | 0% | 88% | 0% | 11%
hf3fs_utils0% | 0% | 0% | 70% | 29%
hf3fs_fuse0% | 0% | 0% | 0% | 100%
Most Complex Files (Top 50)

The McCabe index of a file grows with its size: per 100 lines tells a large but plain file from a dense one, and most complex unit whether the complexity sits in one unit or is spread over many.

File# lines# unitsMcCabe index
(sum)
per 100
lines
most complex
unit
FuseOps.cc
in src/fuse
2255 62 450 20 48
ArgParse.h
in src/common/utils
1231 63 258 21 35
RobinHood.h
in src/common/utils
1796 125 256 14 11
StorageClientImpl.cc
in src/client/storage
2075 52 233 11 18
Utf8.h
in src/common/utils
1083 20 230 21 67
RapidCsv.h
in src/common/utils
953 69 222 23 23
hf3fs_expected.h
in src/lib/api
1366 99 218 16 18
MagicEnum.hpp
in src/common/utils
1453 55 214 15 17
UnorderedDense.h
in src/common/utils
1129 95 210 19 13
IBSocket.cc
in src/common/net/ib
1073 52 204 19 14
Serde.h
in src/common/serde
884 62 190 21 53
MgmtdClient.cc
in src/client/mgmtd
855 75 174 20 12
Linenoise.c
in src/common/utils
836 38 170 20 15
ConfigBase.h
in src/common/utils
771 54 161 21 14
UsrbIo.cc
in src/lib/api
671 26 160 24 18
GcManager.cc
in src/meta/components
787 25 153 19 19
StorageOperator.cc
in src/storage/service
1016 22 153 15 32
Nameof.hpp
in src/common/utils
960 36 144 15 49
BatchOperation.cc
in src/meta/store/ops
641 16 138 22 19
ChunkMetaStore.cc
in src/storage/store
894 32 137 15 17
TypeTraits.h
in src/common/utils
247 2 133 54 130
MetaClient.cc
in src/client/meta
853 45 127 15 19
StorageBench.h
in benchmarks/storage_bench
726 18 117 16 24
IBDevice.cc
in src/common/net/ib
728 25 115 16 22
Utils.h
in src/fbs/meta
401 28 110 27 27
data_placement.py
in deploy/data_placement/src/model
449 35 109 24 19
IBConnect.cc
in src/common/net/ib
646 19 99 15 16
TargetMap.cc
in src/storage/service
370 22 90 24 39
ChunkReplica.cc
in src/storage/store
390 6 78 20 41
FuseClients.cc
in src/fuse
375 6 75 20 36
Transport.cc
in src/common/net
320 15 73 23 14
StorageTarget.cc
in src/storage/store
400 13 71 18 14
MemTransaction.h
in src/common/kv/mem
336 17 71 21 26
RDMABuf.h
in src/common/net/ib
356 45 70 20 4
Serde.cc
in src/common/serde
358 37 70 20 4
__init__.py
in hf3fs
242 30 64 26 9
ResyncWorker.cc
in src/storage/sync
409 5 63 15 42
SetAttr.h
in src/meta/store/ops
142 5 62 44 44
Common.h
in src/fbs/meta
222 44 62 28 7
MetaOperator.cc
in src/meta/service
384 31 61 16 6
Common.h
in src/fbs/storage
665 37 60 9 8
IBSocket.h
in src/common/net/ib
467 45 58 12 8
Rename.cc
in src/meta/store/ops
279 8 57 20 22
PathResolve.cc
in src/meta/store
286 12 55 19 13
Open.cc
in src/meta/store/ops
253 11 55 22 19
Service.h
in src/fbs/meta
636 29 55 9 7
StorageClient.h
in src/client/storage
456 40 54 12 4
IoRing.cc
in src/fuse
240 2 53 22 39
MgmtdMetricsUpdater.cc
in src/mgmtd/background
251 15 52 21 11
Recorder.cc
in src/common/monitor
290 19 52 18 9
About This Analysis
  • File complexity is the sum of the McCabe indexes (conditional complexity) of the units (methods, functions...) in a file.
  • Files are classified in five categories based on that sum: 1-25 (simple files), 26-50 (slightly complex files), 51-125 (medium complex files), 126-250 (complex files), 251+ (very complex files). The default bands are five times the unit complexity bands, as a file is a group of units.
  • Only main code files with units are classified. Files without units (languages without unit analysis, or files without functions) have no complexity to measure and are left out rather than counted as simple.
  • A very complex file holds many decisions, which often means it has too many responsibilities: a candidate to split, and a place where changes need more testing.
Learn more...