Some codebases include many tiny elements (for example, classes under 10 lines of code) that clutter the city layout. Rather than excluding them altogether, this new tool should let the user merge those elements under pre-defined properties so they remain represented but don’t overwhelm the main city view when visually represented. The threshold for what counts as “small” is user-defined, and the user also selects which property triggers this grouping. The grouping should be done locally at every depth of the element tree.
Example tool run:
<codebase>
<elementname="<root_package>"type="package">
<children>
<elementname="MainClass"type="class">
<properties>
<propertyname="LOC"type="int"value="100"/>
</properties>
<children/>
</element>
<elementname="TinyHelper"type="class">
<properties>
<propertyname="LOC"type="int"value="8"/>
</properties>
<children>
<!-- A nested class or element with LOC=4 -->
<elementname="MiniSubclass"type="class">
<properties>
<propertyname="LOC"type="int"value="4"/>
</properties>
<children/>
</element>
</children>
</element>
<elementname="MediumClass"type="class">
<properties>
<propertyname="LOC"type="int"value="50"/>
</properties>
<children/>
</element>
</children>
</element>
</codebase>
java -jar GroupTinyCdfElementsLocally.jar \
--input original.xml \
--property LOC \
--threshold 10 \
--output grouped.xml
<codebase>
<elementname="<root_package>"type="package">
<children>
<!-- main class remains as normal -->
<elementname="MainClass"type="class">
<properties>
<propertyname="LOC"type="int"value="100"/>
</properties>
<children/>
</element>
<!-- medium class remains as normal -->
<elementname="MediumClass"type="class">
<properties>
<propertyname="LOC"type="int"value="50"/>
</properties>
<children/>
</element>
<!-- local container for all tiny siblings under <root_package> -->
<elementname="LocalSmallContainer_1"type="virtual-container">
<properties/>
<children>
<!-- TinyHelper is moved here since LOC=8 < 10 -->
<elementname="TinyHelper"type="class">
<properties>
<propertyname="LOC"type="int"value="8"/>
</properties>
<children>
<!-- new local container inside TinyHelper for MiniSubclass -->
<elementname="LocalSmallContainer_2"type="virtual-container">
<properties/>
<children>
<!-- MiniSubclass is also below threshold (4 < 10) -->
<elementname="MiniSubclass"type="class">
<properties>
<propertyname="LOC"type="int"value="4"/>
</properties>
<children/>
</element>
</children>
</element>
</children>
</element>
</children>
</element>
</children>
</element>
</codebase>
Some codebases include many tiny elements (for example, classes under 10 lines of code) that clutter the city layout. Rather than excluding them altogether, this new tool should let the user merge those elements under pre-defined properties so they remain represented but don’t overwhelm the main city view when visually represented. The threshold for what counts as “small” is user-defined, and the user also selects which property triggers this grouping. The grouping should be done locally at every depth of the element tree.
Example tool run:
java -jar GroupTinyCdfElementsLocally.jar \ --input original.xml \ --property LOC \ --threshold 10 \ --output grouped.xml