Questions tagged [code-analysis]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
62 views

What does render args mean?

In my shipping.html I see this line of code <render args="shippingMethodListTemplate"/> Is this just saying "put the content of this template here" or is there something else going on? EDIT:...
2
votes
0answers
64 views

M2: getBaseUrl() - StoreManagerInterface vs StoreConfigInterface

If someone asks for getting base URL, the answer is always to use StoreManagerInterface, like ... protected $storeManager; public function __construct( ... \Magento\Store\Model\...
21
votes
2answers
764 views

Magento 2 - good practice to use/avoid magic getters?

Magic getters on Varien_Object (M1) and DataObject (M2) are common practice, but with Magento 2 it feels wrong to use it. Good: easy to read/write Bad It causes problems when using digits in keys (...
1
vote
0answers
79 views

Outdated codesniffer in MEQP2 composer.json for Magento 2.2?

How to correctly test against MEQP2 standard? Normally i use vendor/bin/phpcs --standard=PSR2 To supress errors a i use this: //phpcs:ignore or //phpcs:disable PSR2 When using MEQP2 standards ...
1
vote
3answers
707 views

Magento 2 : Are php code sniffers the right tool for extension development?

I am creating a custom extension for Magento 2 and looking for the tool that can help me in the code standards. I come to know about PHP code sniffers from google. Is the PHP code sniffer is right ...
0
votes
2answers
218 views

how to reduce the magento website page load time? [duplicate]

I presume the website pages are slow down because of this filter to get only configurable products.. I used ->addAttributeToFilter('type_id', array('eq' => 'configurable')); this code works ...
1
vote
1answer
167 views

How to decrease brand product list page load time in magento?

I am collecting brand specific products based on the brandId in brandproductlist.php as follows., $collection = Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect('*')...
0
votes
1answer
32 views

Access single variable values globally in magento wihin .php files

I want to access $brandId in all other .php files in magento.. How do I do it? $brandId = array_search($brand_name, array_map('strtolower',$this->getAvailableBrands())); is in code/core/...
0
votes
1answer
2k views

Call to a member function setUrl() on a non-object after security patch SUPEE-8788. Please help me with this. Magestore Giftvoucher [duplicate]

class Magestore_Giftvoucher_Block_Product_Upload extends Mage_Adminhtml_Block_Media_Uploader { public function __construct() { parent::__construct(); $this->setId($this->getId() . '...
0
votes
2answers
268 views

Magento - Remove tax from all products quote. (Update)

I saw there are some post like this but I tried that answer and dit not work. I am learning how to use magento, and What I wan to try is remove all the tax from the cliente when them have add 3 ...
3
votes
1answer
101 views

What is the point of the assign() function in Mage_Rating_Block_Entity_Detailed?

I'm studying Magento and trying to wrap my head around the way this particular function is set up. In the Mage_Rating_Block_Entity_Detailed block, this line creates the $collection variable that can ...
14
votes
2answers
2k views

What do “#@+” & “#@-” strings mean in the comments?

I see a lot of "#@+" & "#@-" strings in the comments of the some Magento 2 classes. \Magento\Customer\Api\Data\AttributeMetadataInterface interface AttributeMetadataInterface extends \Magento\...
1
vote
0answers
43 views

Code Review: Trying to get popular categories

On a main category page there is a section for "popular ranges" where a range is a different sub category. A simplified version of my category structure is: root |-Bathrooms |--Sinks |--Cabinets |-...
2
votes
2answers
45 views

Badly coded module - how to explain this to other stakeholders [closed]

A client wants to integrate with a 3rd party that already have a freely available module. The only issue is the code in the module is pretty bad so I don't want to integrate it but the other ...
3
votes
1answer
181 views

Magento 2 Extension Scrutinizer Dependencies Error

I'm trying to run some auto-code-review in scrutinizer-ci for a new extension, the problem is that the builder can't find these composer dependencies: "magento/framework": "~100.0", "magento/module-...
30
votes
2answers
3k views

Why are so many PHP functions disallowed in the Magento ECG Coding Standard?

The Magento ECG Coding Standard seems to be (at least kind of) official as standard for Magento 1 extensions: https://github.com/magento-ecg/coding-standard But I don't understand the reasoning ...
3
votes
0answers
175 views

How can I get pdepend to give me accurate results for my extension [closed]

pdepend is a useful tool for doing static analysis on a php codebase, but it doesn't know how to interpret Mage::(getBlock|getModel|helper|…) factory methods to their actual classnames. Factories may ...
3
votes
1answer
592 views

Learning Magento from reviewing the core files

Prior to using Magento I had only used procedural programming techniques (and the code I wrote was very rarely reusable), although I was aware of oo, I had never had the need to use it, let alone use ...
2
votes
2answers
2k views

Going from Admin Panel to Source Code and finding out what is running under the hood

I have a simple example. Say my system is messed up and I want to disable the cache manually because my admin panel is not working. How do I go from figuring out what component is run, and what php I ...
1
vote
0answers
40 views

Does Magento 1.x follow any coding convention? [duplicate]

I didn't find any official resource saying that Magento 1.x follow a coding convention. Do you know which coding convention Magento 1.x follows? Thanks
23
votes
5answers
9k views

How do I get a list of all class rewrites?

Is there a way to list all rewrites and maybe other potential conflicts besides reviewing all configuration files? I have to analyse some projects with lots of extensions and custom modifications and ...