Extract String Java Constants and identify labels in properties files


I am a newbie with sonar qube and I was trying to learn how to extend some of the sonar scanning capabilities.
I would like to be able to highlight when a new label or String hard-coded sentence is added in the java code.
For example:
String error = “This is an error message”;
The sonar qube linter should be able to highlight this message in the gitlab MR and I would like to be able to get this for the new code as well as for all the existing code.

Do you also know if there is a way to extract all the key-value pairs from file with extension properties that looks like
error.message=This is an error


Hello @jubecca

In case you are still interested, I believe custom rules are the way to go do this kind of thing: Writing Custom Java Rules 101.