Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TRACKER] List of unused signals #37604

Open
13 of 22 tasks
qarmin opened this issue Apr 5, 2020 · 5 comments
Open
13 of 22 tasks

[TRACKER] List of unused signals #37604

qarmin opened this issue Apr 5, 2020 · 5 comments

Comments

@qarmin
Copy link
Contributor

qarmin commented Apr 5, 2020

Godot version:
4.0.dev.custom_build. 321ce4d

Issue description:

With help of https://github.com/qarmin/godot_signal_checker (which could be rewritten to python to be able to put it inside CI in Godot repository) I found lot of potential unused signals with this methodology:

Added signals have at the beginning of line ADD_SIGNAL(MethodInfo(\"
Emitted signals have at the beginning of line emit_signal(CoreStringNames::get_singleton()->, emit_signal(SceneStringNames::get_singleton()-> or emit_signal(\"
Connected signals have at the beginning of line ->connect(\" or connect_compat(\"

Signals which are emitted and connected but never added

Signals which are added but never emitted or connected

  • - bake_finished
  • - clear_request
  • - copy_request
  • - item_custom_button_pressed
  • - item_group_status_changed
  • - item_lock_status_changed
  • - pause_pressed
  • - search

Signals which are added and connected but never emitted

  • - autoload_changed
  • - export_presets_updated
  • - group_edited
  • - inputmap_changed
  • - localization_changed
  • - multiple_properties_changed
  • - node_added
  • - node_removed
  • - preview_invalidated
  • - property_edited
  • - removed_from_graph
@qarmin qarmin added this to the 4.0 milestone Apr 5, 2020
@qarmin
Copy link
Contributor Author

qarmin commented Sep 10, 2020

I created small program in Rust which search for unused signals - https://github.com/qarmin/godot_signal_checker
Linux binaries - https://github.com/qarmin/godot_signal_checker/releases/download/0.10/godot_unusable_signals
Usage
godot_unusable_signals path_to_godot_repository

I checked commit 0819657

With help of this program I found automatically a lot of possible unused signals

Signal dpi_changed is emitted but never added or connected
Signal drop_attempted is emitted but never added or connected

Signal clear_request is added but never emitted or connected
Signal item_lock_status_changed is added but never emitted or connected
Signal item_group_status_changed is added but never emitted or connected
Signal item_custom_button_pressed is added but never emitted or connected
Signal bake_finished is added but never emitted or connected
Signal copy_request is added but never emitted or connected
Signal search is added but never emitted or connected
Signal pause_pressed is added but never emitted or connected

Signal inputmap_changed is added and connected but never emitted
Signal multiple_properties_changed is added and connected but never emitted
Signal removed_from_graph is added and connected but never emitted
Signal export_presets_updated is added and connected but never emitted
Signal preview_invalidated is added and connected but never emitted
Signal group_edited is added and connected but never emitted
Signal localization_changed is added and connected but never emitted
Signal node_added is added and connected but never emitted
Signal autoload_changed is added and connected but never emitted
Signal property_edited is added and connected but never emitted
Signal node_removed is added and connected but never emitted

Emitted and added signals but never connected are probably not a bug, because user may want to connect them manually

Signal screen_exited is emitted and added but never connected
Signal sleeping_state_changed is emitted and added but never connected
Signal interface_removed is emitted and added but never connected
Signal scene_closed is emitted and added but never connected
Signal scroll_started is emitted and added but never connected
Signal continued is emitted and added but never connected
Signal variant_field_changed is emitted and added but never connected
Signal camera_feed_removed is emitted and added but never connected
Signal frame_changed is emitted and added but never connected
Signal files_moved is emitted and added but never connected
Signal body_entered is emitted and added but never connected
Signal joy_connection_changed is emitted and added but never connected
Signal meta_hover_started is emitted and added but never connected
Signal animation_step_changed is emitted and added but never connected
Signal navigation_mesh_changed is emitted and added but never connected
Signal tab_selected is emitted and added but never connected
Signal editor_script_changed is emitted and added but never connected
Signal ramp_changed is emitted and added but never connected
Signal hide is emitted and added but never connected
Signal on_request_permissions_result is emitted and added but never connected
Signal peer_packet is emitted and added but never connected
Signal target_reached is emitted and added but never connected
Signal path_changed is emitted and added but never connected
Signal body_exited is emitted and added but never connected
Signal viewport_exited is emitted and added but never connected
Signal mesh_updated is emitted and added but never connected
Signal tracker_added is emitted and added but never connected
Signal physics_frame is emitted and added but never connected
Signal velocity_computed is emitted and added but never connected
Signal clear_selection is emitted and added but never connected
Signal released is emitted and added but never connected
Signal custom_nodes_updated is emitted and added but never connected
Signal camera_entered is emitted and added but never connected
Signal keying_changed is emitted and added but never connected
Signal viewport_entered is emitted and added but never connected
Signal text_change_rejected is emitted and added but never connected
Signal texture_changed is emitted and added but never connected
Signal ice_candidate_created is emitted and added but never connected
Signal input_event is emitted and added but never connected
Signal camera_feed_added is emitted and added but never connected
Signal tab_clicked is emitted and added but never connected
Signal resource_edit_request is emitted and added but never connected
Signal animation_changed is emitted and added but never connected
Signal transform_key_request is emitted and added but never connected
Signal node_unselected is emitted and added but never connected
Signal scene_changed is emitted and added but never connected
Signal area_entered is emitted and added but never connected
Signal data_channel_received is emitted and added but never connected
Signal tracks_changed is emitted and added but never connected
Signal area_shape_exited is emitted and added but never connected
Signal button_up is emitted and added but never connected
Signal item_focused is emitted and added but never connected
Signal connection_error is emitted and added but never connected
Signal preset_removed is emitted and added but never connected
Signal area_exited is emitted and added but never connected
Signal interface_added is emitted and added but never connected
Signal client_close_request is emitted and added but never connected
Signal scroll_ended is emitted and added but never connected
Signal button_release is emitted and added but never connected
Signal connection_established is emitted and added but never connected
Signal item_rmb_edited is emitted and added but never connected
Signal main_screen_changed is emitted and added but never connected
Signal body_shape_exited is emitted and added but never connected
Signal area_shape_entered is emitted and added but never connected
Signal folder_moved is emitted and added but never connected
Signal animation_finished is emitted and added but never connected
Signal tween_all_completed is emitted and added but never connected
Signal connection_closed is emitted and added but never connected
Signal camera_exited is emitted and added but never connected
Signal broadcast is emitted and added but never connected
Signal data_received is emitted and added but never connected
Signal custom_popup_edited is emitted and added but never connected
Signal animation_started is emitted and added but never connected
Signal session_description_created is emitted and added but never connected
Signal frame_post_draw is emitted and added but never connected
Signal tween_completed is emitted and added but never connected
Signal meta_hover_ended is emitted and added but never connected
Signal script_close is emitted and added but never connected
Signal body_shape_entered is emitted and added but never connected
Signal ready is emitted and added but never connected
Signal tween_started is emitted and added but never connected
Signal version_changed is emitted and added but never connected
Signal tween_step is emitted and added but never connected
Signal tree_entered is emitted and added but never connected
Signal screen_entered is emitted and added but never connected
Signal network_peer_packet is emitted and added but never connected
Signal preset_added is emitted and added but never connected
Signal completed is emitted and added but never connected
Signal navigation_finished is emitted and added but never connected
Signal server_close_request is emitted and added but never connected
Signal column_title_pressed is emitted and added but never connected
Signal tracker_removed is emitted and added but never connected

@qarmin qarmin changed the title List of probably unused signals List of unused signals Sep 10, 2020
@Calinou Calinou changed the title List of unused signals [TRACKER] List of unused signals Aug 8, 2021
@DanielKriz
Copy link
Contributor

I did the python rewrite of the godot_signal_checker script, https://github.com/DanielKriz/godot_signal_checker. But I don't know if it is still relevant. It has been tested towards the origin on the newest version of godot.

@akien-mga
Copy link
Member

Signals which are added and connected but never emitted

This category is wrong, all these are emitted via add_do_method(..., "emit_signal", ...) or call_deferred("emit_signal", ...).
Sometimes via a String or StringName member variable to avoid repeating the string.

@akien-mga
Copy link
Member

@DanielKriz I tried your script, it's helpful but it would be great if it could do this:

  • Include the name of the class (or at least C++ file) where the signal was found
  • Improve the checks as I see quite some false positives, possibly due to changes in the code since this was first authored in 2020 then ported (e.g. it doesn't seem to take SNAME() into account). Plus the points I raised above (not all easy to solve via regex, but some are).

@DanielKriz
Copy link
Contributor

I am going to try to look into in after exams. It would be great if the script would be helpful in some way.

akien-mga added a commit to akien-mga/godot that referenced this issue Jan 31, 2023
@akien-mga akien-mga modified the milestones: 4.0, 4.x Feb 1, 2023
Streq pushed a commit to Streq/godot that referenced this issue Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

4 participants