Delete the private functions and fields nothing used - #644
Merged
Merged
Conversation
The viewport drop path was a duplicate: plugin_drop_handler.gd is the live one, reached through the two Godot virtuals, and it dispatches the four payload kinds itself. The eight wrappers in front of that dispatch had no caller. Four architecture tests were keeping these alive. Each enumerates module methods and asserts plugin.gd contains a delegation string for every one, and the lists had grown to include helpers the modules call themselves: update_preview, apply_value, do_displacement_stroke, point_near_polygon_3d, update_prefab_hover, move_selected_vertical. The only way to satisfy that was a wrapper nothing called. The lists are now the entry points plugin.gd actually owns. The drop test also asserts plugin.gd does not classify the payloads itself, which is the property "thin delegate" was reaching for and the old list did not check.
Twenty in dock.gd, eight in level_root.gd, and seven elsewhere, plus the nine fields from #610. map_io.gd's _format_face_line was a drifted second copy of the .map face line. It takes three arguments and hard-codes the texture and the 0 0 0 1 1 tail; the three adapters take (a, b, c, texture, face_data) and read real UV data off FaceData. Nothing could have called it even by accident. drag_active was worse than unused. Its setter called input_state.cancel() while cancel_drag() is input_state.cancel() and _clear_preview(), so setting it false did half a cancel and orphaned the preview brush. It is public on a registered custom type, so anyone who found it got the broken half. grid_plane_axis and _entity_props_entity were written and never read, so the writes went with the declarations. selection_has_brush and selection_has_entity became provably dead once their only caller, a dead plugin.gd wrapper, was gone. Rerunning the scan afterwards finds no third layer: zero functions, zero fields.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Sep 16, 2026
Fifty-nine private functions with no call site, including two drifted duplicate implementations
#609
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #609
Fixes #610
plugin.gdandlevel_root.gdare documented as thin coordinators whose named one-line delegates exist to be called by name, and the rule beside that is that a delegate with no caller gets deleted. Fifty-seven private functions and nine fields had drifted past it.The lists were stale, so I re-derived them
The issue lists were taken a while ago and two of their own instructions no longer hold:
_on_shortcuts_helppending The searchable shortcut dialog cannot be opened: the '?' button the user guide documents does not exist #606. The searchable shortcut dialog cannot be opened: the '?' button the user guide documents does not exist #606 is merged, that handler is connected atdock.gd:2058, andtest_unreachable_entry_points.gdholds it there. It is not on the list._point_near_polygon_3dis dead but my scan missed it, because the name appears in prose elsewhere and the method counts any mention as a caller. That makes the scan conservative, never aggressive, which is the right direction — but it means each deletion still needs its own grep, which each one got.What was actually keeping this alive
Five architecture tests, and this is the more useful half of the finding.
Each enumerates a module's methods and asserts
plugin.gdcontains a delegation string for every one:Those lists had grown to include helpers the modules call themselves:
update_preview,apply_value,do_displacement_stroke,point_near_polygon_3d,update_prefab_hover,move_selected_vertical,normalize_editor_selection,expand_native_group_selection,same_node_selection,sync_hf_selection_if_empty,face_screen_center,show_quick_property,ensure_vertex_overlay. The only way to satisfy the assertion was a wrapper nothing called, so tests written to keepplugin.gdthin were requiring it to be thicker.I checked every one: all are reachable through entry points
plugin.gdgenuinely does delegate. Each list is now those entry points, and the drop test additionally assertsplugin.gddoes not contain the payload type strings. That is what "thin delegate" was reaching for; the enumeration could pass whileplugin.gdheld a full duplicate of the classification.Three that are more than dead weight
map_io.gd:_format_face_lineis a drifted second copy of the.mapface line. It takes three arguments and hard-codes the texture and the0 0 0 1 1tail; the three adapters take(a, b, c, texture, face_data)and read real UV data offFaceData. The signatures differ, so nothing could have called it even by accident, and a second copy of the export format is a trap for whoever fixes the exporter next.LevelRoot.drag_activeis a latent bug, not dead weight. Its setter callsinput_state.cancel(); the canonicalcancel_drag()isinput_state.cancel()and_clear_preview(). Sodrag_active = falsedid half a cancel and left the preview brush orphaned in the scene. It is public on a registered custom type, so anyone who found it got the broken half.DraftEntity.entity_propertieswas a second public name forentity_datathat nothing used. Two names for one dictionary can only diverge.Both public deletions are a break for any script that touched them, which is stated here rather than buried.
Deleting exposed one more layer, which is also gone
HFPluginSelectionState.selection_has_brush()andselection_has_entity()had exactly one caller each: the deadplugin.gdwrapper. Removing it made them provably dead, so they went in the same pass.Re-running the scan afterwards finds zero function candidates and zero field candidates, so there is no third layer.
grid_plane_axisand_entity_props_entitywere written and never read, so the writes inhf_grid_system.gdanddock_entity_handler.gdwent with the declarations — deleting only the declarations would have left assignments to properties that no longer exist.Docs
CHANGELOG. Nothing else goes stale: the four references in
DEVELOPMENT.mdandROADMAP.mdall point at the liveplugin_drop_handler.gdor the adapter base'sformat_face_line.