Open CrucisGamma opened 2 years ago
I think I would be careful about the approach to this. It probably would be worth sharing some more constants across the application but what the raw numbers don't provide is context. For example "LOW LEVEL" is being used as a plugin tag so it might make more sense to consolidate all the plugin tags into their own constants class rather than dumping it into a large catch all strings constants class.
There might also be examples of strings that while having the same value are used in a number of different contexts and so it might be better to separate those contexts out rather than using one value that all contexts use.
There are probably other examples of that as well so based on that I think creating a series of contextual constant classes would be the best option here (rather than one catch-all)
I would also propose not bothering with extracting any only used a couple of times. I think we should only consolidate strings into constants if we think it's going to be helpful in the long run (even Sonar doesn't care about strings only used a couple of times)
data_for_duplicates2.txt (This was specifically excluding strings related to any unit test java files)
Thanks @CrucisGamma. This will be handy for things I wanted to do like looking for spelling errors and identify inconsistencies. Cheers.
Thanks @CrucisGamma. This will be handy for things I wanted to do like looking for spelling errors and identify inconsistencies. Cheers.
I'd agree @arcturus2 . A part of this goes back to inconsistenciies in the UX that is jarring for the user once noticed. For example the issue of OK vs Ok (25 individual copies of "OK" throughout the code). (spelling error was deliberate ;))
PluginTags class was created within #1555 and should partially address this.
This issue is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this issue.
This issue is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this issue.
This issue is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this issue.
This issue is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this issue.
This issue is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this issue.
There's lots of the same hardcoded identical strings across lots of files. On my (admittedly incomplete) analysis, these are the single line strings between 4-70 characters that occur across multiple files.
For example, the string "Selected Only" (exact case) exists 24 separate times across all files as analysed 20211019.
It may be a big job to refactor code get a "StringConstants.java" file that is referenced by different modules within Constellation but possibly nice to do.