tensorflow / ecosystem
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 104 units with 1,293 lines of code in units (57.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (57 lines of code)
    • 19 medium size units (539 lines of code)
    • 32 small units (429 lines of code)
    • 52 very small units (268 lines of code)
0% | 4% | 41% | 33% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 13% | 56% | 17% | 12%
scala0% | 0% | 34% | 45% | 19%
java0% | 0% | 33% | 12% | 54%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
spark/spark-tensorflow-distributor0% | 24% | 57% | 6% | 11%
spark/spark-tensorflow-connector0% | 0% | 34% | 45% | 19%
distribution_strategy0% | 0% | 72% | 10% | 17%
hadoop/src0% | 0% | 33% | 12% | 54%
docker0% | 0% | 38% | 46% | 14%
data_service0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _get_spark_task_program()
in spark/spark-tensorflow-distributor/spark_tensorflow_distributor/mirrored_strategy_runner.py
57 5 3
def run()
in spark/spark-tensorflow-distributor/spark_tensorflow_distributor/mirrored_strategy_runner.py
45 7 3
def encodeFeatureList()
in spark/spark-tensorflow-connector/src/main/scala/org/tensorflow/spark/datasources/tfrecords/serde/DefaultTfRecordRowEncoder.scala
41 9 3
private def encodeFeature()
in spark/spark-tensorflow-connector/src/main/scala/org/tensorflow/spark/datasources/tfrecords/serde/DefaultTfRecordRowEncoder.scala
40 22 3
override def shortName()
in spark/spark-tensorflow-connector/src/main/scala/org/tensorflow/spark/datasources/tfrecords/DefaultSource.scala
32 7 0
def __init__()
in spark/spark-tensorflow-distributor/spark_tensorflow_distributor/mirrored_strategy_runner.py
31 4 7
def _check_encryption()
in spark/spark-tensorflow-distributor/spark_tensorflow_distributor/mirrored_strategy_runner.py
30 3 1
private def writePartitionLocal()
in spark/spark-tensorflow-connector/src/main/scala/org/tensorflow/spark/datasources/tfrecords/DefaultSource.scala
30 5 3
def _get_gpus_owned()
in spark/spark-tensorflow-distributor/spark_tensorflow_distributor/mirrored_strategy_runner.py
27 6 2
private def saveDistributed()
in spark/spark-tensorflow-connector/src/main/scala/org/tensorflow/spark/datasources/tfrecords/DefaultSource.scala
27 7 2
def main()
in distribution_strategy/keras_model_to_estimator_client.py
27 5 1
def device_and_target()
in docker/mnist.py
26 9 0
def resolve_cluster()
in distribution_strategy/keras_model_to_estimator_client.py
26 11 2
def main()
in distribution_strategy/keras_model_to_estimator.py
26 5 1
def encodeSequenceExample()
in spark/spark-tensorflow-connector/src/main/scala/org/tensorflow/spark/datasources/tfrecords/serde/DefaultTfRecordRowEncoder.scala
23 7 1
public static boolean convert()
in hadoop/src/main/java/org/tensorflow/hadoop/example/TFRecordFileMRExample.java
23 1 8
def apply[T : TypeTag]()
in spark/spark-tensorflow-connector/src/main/scala/org/tensorflow/spark/datasources/tfrecords/TensorFlowInferSchema.scala
22 8 1
private def decodeFeature()
in spark/spark-tensorflow-connector/src/main/scala/org/tensorflow/spark/datasources/tfrecords/serde/DefaultTfRecordRowDecoder.scala
21 17 3
def inferFeatureListTypes()
in spark/spark-tensorflow-connector/src/main/scala/org/tensorflow/spark/datasources/tfrecords/TensorFlowInferSchema.scala
21 5 4
public RecordWriter getRecordWriter()
in hadoop/src/main/java/org/tensorflow/hadoop/io/TFRecordFileOutputFormatV1.java
21 1 4