Greetings. I am a novice learner in SonarQube world. While trying to extend with a new rules, I got stuck in 2 issues:
API public static void verify(String filename, JavaFileScanner check) is used for testing any new rules where filename– The file to be analyzed
check – The check to be used for the analysis
My question is if my rule (check) needs more than 1 file to validate, how can I do that. I’ve not found any API that allows more than 1 file! More clearly, we can only check the rule against a class tree and have no access to other class’s context. Please correct me if I am wrong somehow.
Based on previous point, do SonarQube engine follow the same strategy-- check the rules file by file or apply the rules on the whole project? In the later case, how can we get to the similar environment in the test environment.
Many thanks in advance.