How can I include php codesniffer and mess detector ruleset or report?

Hey @Shashank_Gupta1 ,

Welcome to the community!

The answer to both your questions is: you need to transform the output of the tools to our generic external issue import JSON format ( Generic Issue Import Format | SonarQube Docs ).
Both tools seem to support outputting the report to either XML or JSON files. So one way of doing this is to save the output to such a file, and than create a custom script that will parse the output and transform it to the SonarQube generic external issues format.
When you get the output in the correct format, all is left to do is to add the sonar.externalIssuesReportPaths pointing to the correct file to your analysis properties.

We have recently added specific support for PHPStan and Psalm (SonarCloud can load issues from PHPStan and Psalm). For tools for which we have specific support, the process is easier because the report transformation step becomes unnecessary.
We will consider if we want to support PHPCS and PHPMD in the future.

Best,
Karim.