We introduced the Ballerina Scan tool to integrate sonar-scan in ballerina. This feature is introduced with Ballerina Update 12 release
Ballerina Scan tool
You can find the relevant documentation in here
https://ballerina.io/learn/scan-tool/https://ballerina.io/learn/scan-tool/
https://github.com/ballerina-platform/static-code-analysis-tool/blob/docs/docs/static-code-analysis-tool/ScanFileConfigurations.md
https://github.com/ballerina-platform/static-code-analysis-tool/blob/docs/docs/static-code-analysis-tool/StaticCodeAnalysisPlatformPlugin.md