app/code/local/Mygento/Yandexdelivery/Block/Adminhtml/Order/View/Tab.php
Method getAjaxButton
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAjaxButton($name, $title, $url)
{
$html = $this->getLayout()->createBlock('adminhtml/widget_button')
->setData([
'label' => Mage::helper('yandexdelivery')->__($title),
Method getTable
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getTable()
{
//таблица с статусами заказа
if (!$this->hasYdId()) {
Avoid excessively long class names like Mygento_Yandexdelivery_Block_Adminhtml_Order_View_Tab. Keep class name length under 40. Open
Open
class Mygento_Yandexdelivery_Block_Adminhtml_Order_View_Tab extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
public function _construct()
{
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}
Source https://phpmd.org/rules/naming.html#longclassname
The class Mygento_Yandexdelivery_Block_Adminhtml_Order_View_Tab is not named in CamelCase. Open
Open
class Mygento_Yandexdelivery_Block_Adminhtml_Order_View_Tab extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
public function _construct()
{
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
The variable $_shipment is not named in camelCase. Open
Open
public function hasTrack($order)
{
foreach ($order->getShipmentsCollection() as $_shipment) {
foreach ($_shipment->getAllTracks() as $tracknum) {
return $tracknum->getNumber();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_shipment is not named in camelCase. Open
Open
public function hasTrack($order)
{
foreach ($order->getShipmentsCollection() as $_shipment) {
foreach ($_shipment->getAllTracks() as $tracknum) {
return $tracknum->getNumber();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The method _construct is not named in camelCase. Open
Open
public function _construct()
{
parent::_construct();
$this->setTemplate('mygento/yandexdelivery/order/view/tab.phtml');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}