microsoft / nail_agent
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 243 units with 1,624 lines of code in units (80.1% of code).
    • 1 very long units (166 lines of code)
    • 1 long units (63 lines of code)
    • 10 medium size units (298 lines of code)
    • 21 small units (296 lines of code)
    • 210 very small units (801 lines of code)
10% | 3% | 18% | 18% | 49%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py10% | 3% | 18% | 18% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
agent/affordance_extractors40% | 0% | 35% | 14% | 10%
agent/decision_modules0% | 12% | 31% | 11% | 45%
agent0% | 0% | 0% | 23% | 76%
ROOT0% | 0% | 0% | 100% | 0%
agent/valid_detectors0% | 0% | 0% | 80% | 20%
agent/entity_detectors0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_log_prob_calibration_thresholds()
in agent/affordance_extractors/lm_affordance_extractor.py
166 47 1
def take_control()
in agent/decision_modules/navigator.py
63 5 1
def take_control()
in agent/decision_modules/examiner.py
46 12 1
def init_affordable_attributes()
in agent/affordance_extractors/lm_affordance_extractor.py
45 6 1
def extract_single_object_actions()
in agent/affordance_extractors/lm_affordance_extractor.py
33 14 2
def get_eagerness()
in agent/decision_modules/interactor.py
33 18 1
def take_control()
in agent/decision_modules/interactor.py
26 14 1
def get_action()
in agent/decision_modules/navigator.py
26 7 1
def parse_response()
in agent/decision_modules/hoarder.py
24 6 2
def extract_unknown_actions_with_log_probs()
in agent/affordance_extractors/lm_affordance_extractor.py
23 6 2
def __init__()
in agent/affordance_extractors/lm_affordance_extractor.py
21 1 1
def extract_double_object_actions()
in agent/affordance_extractors/lm_affordance_extractor.py
21 5 3
def take_action()
in agent/nail.py
20 10 2
def estimate_attribute_prob()
in agent/affordance_extractors/lm_affordance_extractor.py
19 5 3
def take_control()
in agent/decision_modules/idler.py
17 7 1
def __str__()
in agent/knowledge_graph.py
17 6 1
def __init__()
in agent/nail.py
16 3 5
def get_double_action()
in agent/decision_modules/idler.py
15 4 1
def add()
in agent/knowledge_graph.py
15 5 2
def shortest_path()
in agent/knowledge_graph.py
15 8 4