I don't want to keep maintaining this plugin. Feel free to ping me if you want to take over.
This SonarQube plugin analyzes JSON files and:
You're thinking of new valuable rules? Version 2.0 or greater provides an API to write your own custom checks. A sample plugin with detailed explanations is available here. If your custom rules may benefit the community, feel free to create a pull request in order to make the rule available in the JSON analyzer.
You're thinking of new rules that may benefit the community but don't have the time or the skills to write them? Feel free to create an issue for your rules to be taken under consideration.
If a JSON file is containing some heavily nested objects (more than a hundred nested levels), you may face a StackOverflowError looking like:
Exception in thread "main" java.lang.StackOverflowError
at com.sonar.sslr.impl.typed.SyntaxTreeCreator.convertChildren(SyntaxTreeCreator.java:128)
at com.sonar.sslr.impl.typed.SyntaxTreeCreator.visitNonTerminal(SyntaxTreeCreator.java:119)
at com.sonar.sslr.impl.typed.SyntaxTreeCreator.visit(SyntaxTreeCreator.java:72)
at com.sonar.sslr.impl.typed.SyntaxTreeCreator.visitNonTerminal(SyntaxTreeCreator.java:89)
at com.sonar.sslr.impl.typed.SyntaxTreeCreator.visit(SyntaxTreeCreator.java:72)
at com.sonar.sslr.impl.typed.SyntaxTreeCreator.convertChildren(SyntaxTreeCreator.java:129)
at com.sonar.sslr.impl.typed.SyntaxTreeCreator.visitNonTerminal(SyntaxTreeCreator.java:119)
...
Increasing the JVM stack size should fix your issue.
If you are running your analysis with:
SONAR_SCANNER_OPTS environment variable to -Xss10m for instanceMAVEN_OPTS environment variable to -Xss10m for instanceand rerun your analysis.