bazelbuild / rules_cc
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 129 units with 2,408 lines of code in units (22.0% of code).
    • 2 very long units (286 lines of code)
    • 6 long units (337 lines of code)
    • 30 medium size units (956 lines of code)
    • 28 small units (416 lines of code)
    • 63 very small units (413 lines of code)
11% | 13% | 39% | 17% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py19% | 23% | 33% | 11% | 11%
go8% | 9% | 42% | 21% | 18%
cc0% | 0% | 51% | 14% | 33%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tools/migration13% | 15% | 38% | 17% | 15%
tools/runfiles0% | 0% | 43% | 18% | 37%
cc/private/toolchain0% | 0% | 81% | 0% | 18%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def migrate_legacy_fields()
in tools/migration/legacy_fields_migration_lib.py
185 21 1
func Transform()
in tools/migration/crosstool_to_starlark_lib.go
101 20 1
def compare_ctoolchains()
in tools/migration/ctoolchain_comparator_lib.py
62 18 2
func getStringArrStatement()
in tools/migration/crosstool_to_starlark_lib.go
60 11 5
func getIfStatement()
in tools/migration/crosstool_to_starlark_lib.go
56 11 7
def _extract_legacy_link_flag_sets_for()
in tools/migration/legacy_fields_migration_lib.py
55 16 1
def _compare_features()
in tools/migration/ctoolchain_comparator_lib.py
52 16 2
def _compare_action_configs()
in tools/migration/ctoolchain_comparator_lib.py
52 16 2
func parseFlagGroup()
in tools/migration/crosstool_to_starlark_lib.go
48 12 2
func getAssignmentStatement()
in tools/migration/crosstool_to_starlark_lib.go
46 9 7
def _compare_artifact_name_patterns()
in tools/migration/ctoolchain_comparator_lib.py
45 12 2
bool PathsFrom()
in tools/runfiles/runfiles_src.cc
43 14 7
def _compare_tool_paths()
in tools/migration/ctoolchain_comparator_lib.py
42 14 2
def _compare_make_variables()
in tools/migration/ctoolchain_comparator_lib.py
41 12 2
func main()
in tools/migration/convert_crosstool_to_starlark.go
38 10 0
func getRule()
in tools/migration/crosstool_to_starlark_lib.go
36 5 2
func getActions()
in tools/migration/crosstool_to_starlark_lib.go
36 7 1
int main()
in cc/private/toolchain/libtool_check_unique.cc
35 10 2
def _read_crosstool_or_ctoolchain_proto()
in tools/migration/ctoolchain_comparator.py
34 7 2
bool ParseManifest()
in tools/runfiles/runfiles_src.cc
33 6 3