The Magento Marketplace Extension Quality Program will incorporate version 3 of the Code Sniff test into automated testing on 7/11/19.
With the assistance of ExtDN and the community (Thank You everyone!), there have been several updates and changes to the Code Sniff test. Included with this effort, we also consolidated the test across Magento (internally and externally).
Our desire is to keep this test as up to date as possible, but we recognize that we also need to give extension developers time to understand any new criteria that could potentially cause their submissions to fail. Due to this, we have decided to create two different update cadences, Warnings and Fixes and Errors.
To assist you with troubleshooting any errors, we are now showing the test version number in the test report as well.
You can find all versions of this test on github and packagist:
https://github.com/magento/magento-coding-standard/releases
https://packagist.org/packages/magento/magento-coding-standard
This post is also announcing the re-structuring of the severities and the addition of 5 new Sev 10 errors and 5 new warnings. We will start using version 3 in the Extension Quality Program on 7/11/19
New classifications for Errors and Warnings:
Type |
Severity |
Description |
Error |
10 |
Critical code issue. |
Warning |
9 |
Possible security and issues that may cause bugs. |
Warning |
8 |
Magento specific code issue. |
Warning |
7 |
General code issue. |
Warning |
6 |
Code style issue (PSR2). |
Warning |
5 |
PHPDoc formatting or commenting issue. |
New rules:
Sev 10 Error: Generic.PHP.NoSilencedErrors - Throws an error or warning when any code prefixed with an asperand is encountered. (increased from 8)
Sev 10 Error: Magento2.Security.IncludeFile - Detects possible improper usage of include functions.
Sev 10 Error: Magento2.Security.InsecureFunction - Detects the use of insecure functions like `shell_exec`, `exec`, `system`, etc.
Sev 10 Error: Magento2.PHP.FinalImplementation - The use of final classes and methods is prohibited because they cannot be intercepted.
Sev 10 Error: Magento2.Classes.DiscouragedDependencies - Detects explicit request of proxies and interceptors in constructors.
Sev 8 Warning: Magento2.Classes.AbstractApi - Restricts abstract classes to not being marked as public @api.
Sev 8 Warning: Magento2.Exceptions.ThrowCatch - ensures that exceptions are not handled in the same function where they are thrown.
Sev 8 Warning: Magento2.Functions.StaticFunction - Detects the use of static methods which are discouraged in Magento.
Sev 7 Warning: Squiz.Operators.ValidLogicalOperators - Ensures logical operators `and` and `or` are not used.
Sev 7 Warning: Magento2.Performance.ForeachArrayMerge - Detects array_merge(...) is used in a loop and is a resources greedy construction.
Full list of Sniffs can be found here: https://github.com/magento/magento-coding-standard/wiki/Magento-Marketplace-Extensions-Verification
As always, please reach out to us via one of the following methods if you have any questions or feedback:
https://marketplacesupport.magento.com
@MagentoMP on Twitter
#marketplace or #coding-standard on Magento Community Engineering Slack
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.