microsoft / checkedc-lnt
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 915 units with 12,087 lines of code in units (68.2% of code).
    • 10 very long units (1,950 lines of code)
    • 29 long units (2,073 lines of code)
    • 91 medium size units (2,744 lines of code)
    • 163 small units (2,440 lines of code)
    • 622 very small units (2,880 lines of code)
16% | 17% | 22% | 20% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py20% | 20% | 20% | 16% | 21%
js10% | 12% | 23% | 26% | 27%
cpp0% | 0% | 66% | 14% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lnt/server/ui15% | 15% | 21% | 23% | 24%
lnt/server/db25% | 14% | 24% | 14% | 20%
lnt/server/reporting37% | 5% | 33% | 9% | 13%
lnt/testing/util39% | 13% | 0% | 30% | 17%
lnt/lnttool0% | 64% | 26% | 8% | 1%
lnt/util0% | 36% | 17% | 21% | 23%
lnt/testing/profile0% | 0% | 28% | 20% | 51%
lnt/server0% | 0% | 33% | 31% | 35%
lnt/testing0% | 0% | 27% | 21% | 51%
lnt/formats0% | 0% | 0% | 62% | 37%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in lnt/server/db/testsuitedb.py
399 60 4
def v4_graph()
in lnt/server/ui/views.py
343 100 0
(function()()
in lnt/server/ui/static/flot/excanvas.js
233 4 1
def v4_matrix()
in lnt/server/ui/views.py
170 35 0
def get_cc_info()
in lnt/testing/util/compilers.py
169 7 2
def generate_run_report()
in lnt/server/reporting/runs.py
153 16 10
_display_cfg: function()
in lnt/server/ui/static/lnt_profile.js
131 5 1
def build()
in lnt/server/reporting/dailyreport.py
127 26 1
Graph2D_Axis.prototype.draw = function()
in lnt/server/ui/static/View2D.js
123 20 5
def _build_data_table()
in lnt/server/reporting/summaryreport.py
102 38 1
def action_create()
in lnt/lnttool/create.py
96 8 2
def print_report_result()
in lnt/util/ImportData.py
95 30 4
def import_and_report()
in lnt/util/ImportData.py
93 7 9
contextPrototype.drawImage = function()
in lnt/server/ui/static/flot/excanvas.js
90 9 2
function appendFill()
in lnt/server/ui/static/flot/excanvas.js
90 9 4
def v4_regression_detail()
in lnt/server/ui/regression_views.py
89 11 1
def get_base_for_testsuite()
in lnt/server/db/migrations/upgrade_0_to_1.py
85 13 1
def update_testsuite()
in lnt/server/db/migrations/upgrade_1_to_2.py
83 24 3
def v4_regression_list()
in lnt/server/ui/regression_views.py
81 22 0
contextPrototype.stroke = function()
in lnt/server/ui/static/flot/excanvas.js
77 21 1