awslabs / predictive-maintenance-using-machine-learning
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 8,697 units with 100,254 lines of code in units (79.9% of code).
    • 50 very long units (7,798 lines of code)
    • 209 long units (13,943 lines of code)
    • 1,020 medium size units (31,246 lines of code)
    • 1,494 small units (22,024 lines of code)
    • 5,924 very small units (25,243 lines of code)
7% | 13% | 31% | 21% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 13% | 31% | 21% | 25%
c54% | 0% | 8% | 13% | 23%
h0% | 0% | 0% | 15% | 84%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/predictive_maintenance/numpy/f2py45% | 18% | 18% | 7% | 10%
source/predictive_maintenance/pandas/core3% | 13% | 32% | 24% | 26%
source/predictive_maintenance/numpy/lib16% | 15% | 24% | 19% | 24%
source/predictive_maintenance/pandas/io8% | 16% | 35% | 21% | 17%
source/predictive_maintenance/numpy/distutils8% | 11% | 35% | 19% | 25%
source/predictive_maintenance/numpy/core9% | 13% | 25% | 18% | 32%
source/predictive_maintenance/pandas/plotting6% | 15% | 32% | 25% | 19%
source/predictive_maintenance/numpy/polynomial0% | 12% | 26% | 32% | 28%
source/predictive_maintenance/numpy/ma0% | 8% | 35% | 25% | 30%
source/predictive_maintenance/pandas/util0% | 15% | 38% | 19% | 25%
source/predictive_maintenance/numpy/testing0% | 13% | 40% | 22% | 23%
source/predictive_maintenance/pytz0% | 27% | 24% | 13% | 34%
source/predictive_maintenance/numpy/linalg0% | 22% | 31% | 26% | 19%
source/predictive_maintenance/pandas/tseries0% | 7% | 22% | 27% | 43%
source/predictive_maintenance/numpy0% | 25% | 15% | 27% | 32%
source/predictive_maintenance/numpy/matrixlib0% | 0% | 45% | 16% | 37%
source/predictive_maintenance/pandas/compat0% | 0% | 11% | 13% | 75%
source/predictive_maintenance0% | 0% | 62% | 21% | 16%
source/notebooks/sagemaker_predictive_maintenance0% | 0% | 51% | 20% | 28%
source/predictive_maintenance/numpy/fft0% | 0% | 14% | 12% | 72%
source/predictive_maintenance/numpy/random0% | 0% | 82% | 0% | 17%
source/notebooks/sagemaker_predictive_maintenance/sagemaker_predictive_maintenance_entry_point0% | 0% | 0% | 56% | 43%
source/predictive_maintenance/numpy/compat0% | 0% | 0% | 48% | 51%
source/predictive_maintenance/pandas0% | 0% | 0% | 30% | 69%
deployment/solution-assistant/src0% | 0% | 0% | 72% | 27%
source/predictive_maintenance/pandas/errors0% | 0% | 0% | 0% | 100%
source/predictive_maintenance/numpy/doc0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def analyzeline()
in source/predictive_maintenance/numpy/f2py/crackfortran.py
527 178 3
def genfromtxt()
in source/predictive_maintenance/numpy/lib/npyio.py
394 104 23
def analyzevars()
in source/predictive_maintenance/numpy/f2py/crackfortran.py
335 161 1
def _setitem_with_indexer()
in source/predictive_maintenance/pandas/core/indexing.py
212 76 3
def _daily_finder()
in source/predictive_maintenance/pandas/plotting/_converter.py
201 46 3
def loadtxt()
in source/predictive_maintenance/numpy/lib/npyio.py
194 71 11
def readfortrancode()
in source/predictive_maintenance/numpy/f2py/crackfortran.py
191 4 3
def _do_init()
in source/predictive_maintenance/numpy/core/machar.py
186 48 6
def buildhooks()
in source/predictive_maintenance/numpy/f2py/f90mod_rules.py
176 33 1
def encode()
in source/predictive_maintenance/pandas/io/packers.py
171 39 1
def __new__()
in source/predictive_maintenance/pandas/core/indexes/base.py
170 24 8
def run()
in source/predictive_maintenance/numpy/distutils/command/build_ext.py
168 52 1
def buildmodule()
in source/predictive_maintenance/numpy/f2py/rules.py
168 45 2
def build_extension()
in source/predictive_maintenance/numpy/distutils/command/build_ext.py
161 53 2
def build_a_library()
in source/predictive_maintenance/numpy/distutils/command/build_clib.py
152 49 4
int check_and_fix_dimensions()
in source/predictive_maintenance/numpy/f2py/src/fortranobject.c
148 40 3
def run_compile()
in source/predictive_maintenance/numpy/f2py/f2py2e.py
147 58 0
def crackline()
in source/predictive_maintenance/numpy/f2py/crackfortran.py
144 43 2
def getarrlen()
in source/predictive_maintenance/numpy/f2py/crackfortran.py
143 55 3
def create_axes()
in source/predictive_maintenance/pandas/io/pytables.py
143 43 8