microsoft / SynapseML
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 1,991 units with 21,722 lines of code in units (63.6% of code).
    • 3 very long units (438 lines of code)
    • 35 long units (2,201 lines of code)
    • 210 medium size units (6,514 lines of code)
    • 378 small units (5,477 lines of code)
    • 1,365 very small units (7,092 lines of code)
2% | 10% | 29% | 25% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
scala1% | 9% | 30% | 26% | 31%
js32% | 26% | 20% | 12% | 8%
py0% | 10% | 25% | 16% | 46%
java0% | 0% | 30% | 51% | 17%
sbt0% | 0% | 0% | 76% | 24%
R0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cognitive5% | 12% | 29% | 26% | 25%
lightgbm4% | 5% | 23% | 25% | 40%
website28% | 22% | 17% | 15% | 17%
core0% | 10% | 31% | 23% | 34%
vw0% | 11% | 41% | 23% | 23%
opencv0% | 16% | 13% | 25% | 44%
deep-learning0% | 3% | 28% | 35% | 32%
project0% | 0% | 0% | 67% | 32%
ROOT0% | 0% | 0% | 76% | 24%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def this()
in cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/BingImageSearch.scala
211 1 0
def getNumIterations: Int = $()
in lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/params/LightGBMParams.scala
118 1 1
function Videos()
in website/src/pages/videos.js
109 4 0
function SampleSnippet()
in website/src/theme/SampleSnippet/index.js
87 7 1
def this()
in core/src/main/scala/com/microsoft/azure/synapse/ml/train/TrainClassifier.scala
84 16 0
def this()
in core/src/main/scala/com/microsoft/azure/synapse/ml/train/ComputeModelStatistics.scala
80 21 0
private[explainers] def generateSampleSizes()
in core/src/main/scala/com/microsoft/azure/synapse/ml/explainers/KernelSHAPSampler.scala
75 11 2
def this()
in opencv/src/main/scala/com/microsoft/azure/synapse/ml/opencv/ImageTransformer.scala
71 2 0
def getParallelism: String = $()
in lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/params/LightGBMParams.scala
70 1 1
protected def pythonClass()
in core/src/main/scala/com/microsoft/azure/synapse/ml/codegen/Wrappable.scala
68 3 0
private def filterByUserRatingCount()
in core/src/main/scala/com/microsoft/azure/synapse/ml/recommendation/RankingTrainValidationSplit.scala
67 3 1
def getArgs: String = $()
in vw/src/main/scala/com/microsoft/azure/synapse/ml/vw/VowpalWabbitBase.scala
66 8 1
private def trainInternal()
in vw/src/main/scala/com/microsoft/azure/synapse/ml/vw/VowpalWabbitBase.scala
66 8 3
override def fit()
in core/src/main/scala/com/microsoft/azure/synapse/ml/automl/TuneHyperparameters.scala
65 11 1
def this()
in core/src/main/scala/com/microsoft/azure/synapse/ml/train/TrainRegressor.scala
65 12 0
def this()
in cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/SpeechToTextSDK.scala
64 3 0
def setOutputFormat()
in cognitive/src/main/scala/com/microsoft/azure/synapse/ml/cognitive/TextToSpeech.scala
64 3 1
def this()
in core/src/main/scala/com/microsoft/azure/synapse/ml/exploratory/FeatureBalanceMeasure.scala
64 2 0
final def getUseTokenizer: Boolean = $()
in core/src/main/scala/com/microsoft/azure/synapse/ml/featurize/text/TextFeaturizer.scala
64 2 1
def trainCore()
in lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/TrainUtils.scala
62 16 5