Skip to content

Instantly share code, notes, and snippets.

A Guide to Code Reviews

Code reviews are an integral part of our development process as they serve to ensure two key goals: the learning and growth of team members and the delivery of healthy code. While we use various tooling to help us programmatically catch errors and formatting preferences, they are by no means a replacement for extra pairs of eyes.

The code review process should be collaborative and inclusive for the author and reviewers as well as any other teams members wishing to understand the scope of the changes that were made. Most importantly, code reviews are not about being right or wrong but should focus on knowledge transfer and ensuring that requirements are met.

Authors

As on author, the most important rule is to be respectful of the reviewers' time. The easier it is for someone else to read your PR, the quicker and more likely that PR is to be reviewed. While not all PRs are equal, where possible, consider the following to improve the changes you submit:

1. Keep it small

So, t

<?php
class masked_class_Model_Order_Observer {
public function __construct() {
}
/**
* Applies the special price percentage discount
* @param Varien_Event_Observer $observer
<?php
class masked_class_Model_Order_Export {
/**
* Generates an XML file from the order data and places it into
* the var/export directory
*
* @param Mage_Sales_Model_Order $order order object
*
<?php
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
$result = $conn->fetchAll("SELECT * FROM masked_table_name");
foreach($result as $row) {
$masked_value_1 = $row['masked_value_1'];
$masked_value_2 = $row['masked_value_2'];
$masked_value_3 = $row['masked_value_3'];
}
<?php
class masked_name__Adminhtml_masked_name__Controller extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
$this->loadLayout()->renderLayout();
}
public function postAction()