In attempting to write tests for FilterConsumer methods, I have found the update_tags method to be extremely unwieldy and not up to the standards for focus of purpose that I'd like to have for functions/methods. From the perspective of FilterConsumer, the only purpose the update_tags method serves is to route data into the add_tag, remove_tag and create_tag methods, and if it were simply given that data directly as a WebSocket message with either "addTag", "removeTag" or "createTag" as the "type" then the update_tags method could be completely removed. The current "updateTags" messages are coming from TagPopperContent.js, which would need to be refactored to know whether a tag addition, removal or creation is warranted and pass that to the FilterConsumer.
Is it worth refactoring TagPopperContent.js so that FilterConsumer can be cleaned up?
In attempting to write tests for FilterConsumer methods, I have found the update_tags method to be extremely unwieldy and not up to the standards for focus of purpose that I'd like to have for functions/methods. From the perspective of FilterConsumer, the only purpose the update_tags method serves is to route data into the add_tag, remove_tag and create_tag methods, and if it were simply given that data directly as a WebSocket message with either "addTag", "removeTag" or "createTag" as the "type" then the update_tags method could be completely removed. The current "updateTags" messages are coming from TagPopperContent.js, which would need to be refactored to know whether a tag addition, removal or creation is warranted and pass that to the FilterConsumer.
Is it worth refactoring TagPopperContent.js so that FilterConsumer can be cleaned up?