magento / marketplace-eqp

Magento 1.x Coding Standard
http://docs.magento.com/marketplace/user_guide/Resources/pdf/Extension_Quality_Program_Overview.pdf
MIT License
224 stars 68 forks source link

A false positive: «The use of public non-interface method in ACTION is discouraged» when extending parent classes #76

Closed shochdoerfer closed 5 years ago

shochdoerfer commented 6 years ago

When running EQP against our Force Login module the warning "The use of public non-interface method in ACTION is discouraged" shows up for this piece of code. The method in question is part of an interface implemented by the class our class is extending from thus the warning does not seem correct to me.

The warning can be avoided by letting our class implement the interface in question. This means the sniff does not check interfaces implemented by all parent classes but just the interfaces by the class in question.

nntoan commented 5 years ago

Please re-open, the pull request does not look right to me. ActionInterface allowed only execute() method. What if we use ActionInterface different than Framework\App\ActionInterface such as:

screenshot 2018-12-05 11 43 51

lenaorobei commented 5 years ago

@nntoan feel free to create a new issue regarding this particular case. Now MEQP rules do not allow dynamic code check, so all we can rely is a class (interface) name string. This is the reason why this sniff is marked with severity 8 , not 10. In theory it can return false-positive finding.