To check the quality of Magento 2 code or an extension against the Magento coding standard, you can use PHP Mess Detector. The following command analyzes any directory or individual file:

Run the command from the Magento 2 root directory.

Running PHP Mess Detector and checking Magento coding standards
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.