mygento/yandexdelivery

View on GitHub
app/code/local/Mygento/Yandexdelivery/Block/Adminhtml/Order/View/Tab.php

Summary

Maintainability
A
3 hrs
Test Coverage

Method getAjaxButton has 44 lines of code (exceeds 25 allowed). Consider refactoring.
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

        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

      class Mygento_Yandexdelivery_Block_Adminhtml_Order_View_Tab extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface
      {
      
          public function _construct()
          {

      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

      class Mygento_Yandexdelivery_Block_Adminhtml_Order_View_Tab extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface
      {
      
          public function _construct()
          {

      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

          public function hasTrack($order)
          {
              foreach ($order->getShipmentsCollection() as $_shipment) {
                  foreach ($_shipment->getAllTracks() as $tracknum) {
                      return $tracknum->getNumber();

      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

          public function hasTrack($order)
          {
              foreach ($order->getShipmentsCollection() as $_shipment) {
                  foreach ($_shipment->getAllTracks() as $tracknum) {
                      return $tracknum->getNumber();

      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

          public function _construct()
          {
              parent::_construct();
              $this->setTemplate('mygento/yandexdelivery/order/view/tab.phtml');
          }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      There are no issues that match your filters.

      Category
      Status