microsoft / CameraTraps
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,543 units with 31,738 lines of code in units (60.8% of code).
    • 27 very long units (4,861 lines of code)
    • 117 long units (7,745 lines of code)
    • 317 medium size units (10,028 lines of code)
    • 354 small units (5,271 lines of code)
    • 728 very small units (3,833 lines of code)
15% | 24% | 31% | 16% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py12% | 25% | 32% | 16% | 12%
cs52% | 7% | 13% | 13% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
archive18% | 19% | 40% | 13% | 8%
api30% | 27% | 16% | 14% | 11%
data_management17% | 20% | 30% | 20% | 10%
classification8% | 39% | 30% | 14% | 6%
visualization19% | 25% | 38% | 12% | 3%
taxonomy_mapping16% | 27% | 34% | 8% | 12%
detection11% | 27% | 45% | 7% | 7%
research0% | 19% | 30% | 25% | 24%
api_flask_redis0% | 69% | 19% | 7% | 3%
sandbox0% | 0% | 71% | 18% | 9%
benchmark0% | 0% | 18% | 55% | 26%
ROOT0% | 0% | 0% | 33% | 66%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void InitializeComponent()
in api/batch_processing/postprocessing/CameraTrapJsonFileProcessingApp/Form.Designer.cs
432 1 0
delegate void SetProgressBarCallback()
in api/batch_processing/postprocessing/CameraTrapJsonFileProcessingApp/Form.cs
417 35 4
def inception_v2_base()
in archive/classification_marcel/tf-slim/nets/inception_v2.py
351 29 7
def inception_v3_base()
in archive/classification_marcel/tf-slim/nets/inception_v3.py
298 23 5
def process_batch_results()
in api/batch_processing/postprocessing/postprocess_batch_results.py
270 18 1
def s3dg_base()
in archive/classification_marcel/tf-slim/nets/s3dg.py
270 40 9
def find_repeat_detections()
in api/batch_processing/postprocessing/repeat_detection_elimination/repeat_detections_core.py
205 41 3
def inception_v1_base()
in archive/classification_marcel/tf-slim/nets/inception_v1.py
192 17 3
def process_images()
in visualization/visualize_db.py
186 31 4
def csv_to_sequences()
in data_management/importers/idaho-camera-traps.py
173 40 1
def sanity_check_json_db()
in data_management/databases/sanity_check_json_db.py
152 48 2
def initialize_taxonomy_lookup()
in taxonomy_mapping/species_lookup.py
142 20 0
def process_sequences()
in data_management/megadb/converters/cct_to_megadb.py
140 49 3
def main()
in classification/train_classifier.py
134 16 16
def create_batch_job()
in api/batch_processing/api_core/server_orchestration.py
131 35 2
public bool ProcessDetections()
in api/batch_processing/integration/eMammal/WPF-integration-app/eMammalIntegration.cs
125 16 4
def compute_precision_recall_with_sequences()
in archive/detection/eval/analyze_sequence_detection_one_guess_per_sequence.py
124 23 5
def main()
in detection/run_tf_detector_batch.py
118 13 0
def main()
in archive/classification_marcel/tf-slim/train_image_classifier.py
117 22 1
def decode_serialized_example()
in data_management/tfrecords/tools/iterate_tfrecords.py
117 37 3