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

False Positive : Possible slow SQL method #109

Closed kanduvisla closed 5 years ago

kanduvisla commented 5 years ago

I've got an install script that creates a CMS page like this:

$page = $this->pageFactory->create();
$page->setIsActive(true);
$page->setTitle('Error');
$page->setPageLayout('1column');
$page->setContentHeading('Something went wrong');
$page->setContent('<p>It looks like something went wrong while handling your request. More details:</p>');
$page = $this->pageRepository->save($page);

This triggers the "Possible slow SQL method" sniff because the word "like" is in my query.

lenaorobei commented 5 years ago

@kanduvisla thanks for reporting. This is known issue and is one of the reason why we didn't include "Possible SQL" sniff to the consolidated Magento Coding Standard.

kanduvisla commented 5 years ago

Hi @lenaorobei ,

I'm a bit confused now. Magento states that if you want to submit an extension to the marketplace, you have to conform to the MEQP2 standards. So what is this Magento Coding Standard? Is the Extension Quality Program to be deprecated?

lenaorobei commented 5 years ago

@kanduvisla Magento Coding Standard is an ongoing project of coding standards consolidation (Magento core and MEQP). For now Marketplace still uses MEQP. Once we make change we will notify developers about this.

lenaorobei commented 5 years ago

Closing this issue because this repo now contains sniffs for Magento 1.x code only. Please refer to magento/magento-coding-standard for Magento 2.x coding standard.

This rule was removed in magento/magento-coding-standard in order to eliminate false-positive findings.

Starting from 7/11 Marketplace uses magento/magento-coding-standard.