microsoft / malmo
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,678 units with 20,093 lines of code in units (57.7% of code).
    • 3 very long units (474 lines of code)
    • 53 long units (3,611 lines of code)
    • 193 medium size units (5,891 lines of code)
    • 289 small units (4,259 lines of code)
    • 1,140 very small units (5,858 lines of code)
2% | 17% | 29% | 21% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java3% | 18% | 29% | 20% | 28%
cpp0% | 20% | 29% | 20% | 29%
py0% | 8% | 33% | 27% | 31%
h0% | 0% | 20% | 23% | 55%
hpp0% | 0% | 19% | 34% | 45%
c0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Minecraft/src3% | 18% | 29% | 20% | 28%
Malmo/src0% | 19% | 28% | 20% | 30%
MalmoEnv/malmoenv0% | 19% | 28% | 29% | 22%
MalmoEnv/proxyenv0% | 0% | 23% | 33% | 43%
Minecraft0% | 0% | 90% | 0% | 9%
MalmoEnv0% | 0% | 100% | 0% | 0%
scripts/python-wheel0% | 0% | 53% | 0% | 46%
scripts/scoring0% | 0% | 0% | 47% | 52%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
protected boolean onExecute()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/DiscreteMovementCommandsImplementation.java
189 70 3
protected void initialiseComms()
in Minecraft/src/main/java/com/microsoft/Malmo/Client/ClientStateMachine.java
180 33 0
public static void buildMouseOverData()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/ObservationFromRayImplementation.java
105 22 2
private void step()
in Minecraft/src/main/java/com/microsoft/Malmo/Client/MalmoEnvServer.java
98 26 3
private ArrayList createRooms()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/ClassroomDecoratorImplementation.java
96 22 0
public static Variation attemptToGetAsVariant()
in Minecraft/src/main/java/com/microsoft/Malmo/Utils/MinecraftTypeHelper.java
95 15 1
92 23 1
92 14 5
private void findSubgoals()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MazeDecoratorImplementation.java
92 18 3
private boolean getParameters()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/InventoryCommandsImplementation.java
89 19 2
void ALEAgentHost::sendCommand()
in Malmo/src/ALEAgentHost.cpp
88 11 1
public void update()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MovingTargetDecoratorImplementation.java
88 22 1
static public float eval()
in Minecraft/src/main/java/com/microsoft/Malmo/Utils/EvaluationHelper.java
88 23 3
public void install()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/CommandForKey.java
85 18 1
public void writeObservationsToJSON()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/ObservationFromNearbyEntitiesImplementation.java
83 18 2
private void buildPath()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/MazeDecoratorImplementation.java
82 19 4
public void buildOnWorld()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/ClassroomDecoratorImplementation.java
80 19 2
public void onClientTick()
in Minecraft/src/main/java/com/microsoft/Malmo/Client/ClientStateMachine.java
79 25 1
vector MissionSpec::getAllowedCommands()
in Malmo/src/MissionSpec.cpp
77 28 2
private void updateAndScorePlayerVolume()
in Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/BuildBattleDecoratorImplementation.java
77 19 2