mygento/yandexdelivery

View on GitHub

Showing 262 of 262 total issues

Method sign has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function sign($data, $method)
    {
        $data['client_id'] = $this->getConfigData('client_id');

        $secretKey = '';
Severity: Minor
Found in app/code/local/Mygento/Yandexdelivery/Helper/Data.php - About 1 hr to fix

    Function getOrderData has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getOrderData($order) {
    
            if (Mage::getStoreConfig('carriers/' . $this->_name . '/onlyone')) {
                $weight = round(Mage::getStoreConfig('carriers/' . $this->_name . '/oneweight') * 1000 / Mage::getStoreConfig('carriers/' . $this->_name . '/weightunit'), 3);
                $dimensions = Mage::helper($this->_name)->getStandardSizes();
    Severity: Minor
    Found in app/code/local/Mygento/Yandexdelivery/Model/Carrier.php - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function confirmOrder has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        private function confirmOrder($ydId, $senderId, $type, $showAdmin = true)
        {
    
            $result = Mage::getModel('yandexdelivery/carrier')->confirmOrders($ydId, $senderId, $type);
    
    

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method getSizes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getSizes($items, $is_quote)
        {
            $temporary_dimensions = [];
            $weight = 0;
    
    
    Severity: Minor
    Found in app/code/local/Mygento/Yandexdelivery/Helper/Data.php - About 1 hr to fix

      Method createOrder has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function createOrder($orderId, $warehouseId, $senderId, $requisiteId, $date, $street, $house) {
      Severity: Major
      Found in app/code/local/Mygento/Yandexdelivery/Model/Carrier.php - About 50 mins to fix

        The property $_name is not named in camelCase.
        Open

        class Mygento_Yandexdelivery_Helper_Data extends Mage_Core_Helper_Abstract
        {
        
            private $_name = 'yandexdelivery';
        
        

        CamelCasePropertyName

        Since: 0.2

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

        Example

        class ClassName {
            protected $property_name;
        }

        Source

        The parameter $parcel_id is not named in camelCase.
        Open

            public function getSenderParcelDocs($parcel_id) {
                return $this->sendRequest('getSenderParcelDocs', ['parcel_id' => $parcel_id], true);
            }

        CamelCaseParameterName

        Since: 0.2

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

        Example

        class ClassName {
            public function doSomething($user_name) {
            }
        }

        Source

        The class Mygento_Yandexdelivery_Model_Shipment is not named in CamelCase.
        Open

        class Mygento_Yandexdelivery_Model_Shipment extends Mage_Core_Model_Abstract
        {
        
            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 class Mygento_Yandexdelivery_Model_Source_Type is not named in CamelCase.
        Open

        class Mygento_Yandexdelivery_Model_Source_Type
        {
        
            public function toOptionArray()
            {

        CamelCaseClassName

        Since: 0.2

        It is considered best practice to use the CamelCase notation to name classes.

        Example

        class class_name {
        }

        Source

        The parameter $data_string is not named in camelCase.
        Open

            public function processApiIds($data_string) {
        
                $json = json_decode(trim($data_string));
                $res = Mage::getSingleton('core/resource');
        
        

        CamelCaseParameterName

        Since: 0.2

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

        Example

        class ClassName {
            public function doSomething($user_name) {
            }
        }

        Source

        The parameter $order_id is not named in camelCase.
        Open

            public function getSenderOrderLabel($order_id) {
                return $this->sendRequest('getSenderOrderLabel', ['order_id' => $order_id], true);
            }

        CamelCaseParameterName

        Since: 0.2

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

        Example

        class ClassName {
            public function doSomething($user_name) {
            }
        }

        Source

        The class Mygento_Yandexdelivery_Model_Resource_Sender is not named in CamelCase.
        Open

        class Mygento_Yandexdelivery_Model_Resource_Sender extends Mage_Core_Model_Resource_Db_Abstract
        {
        
            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 class Mygento_Yandexdelivery_Model_Sender is not named in CamelCase.
        Open

        class Mygento_Yandexdelivery_Model_Sender extends Mage_Core_Model_Abstract
        {
        
            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 class Mygento_Yandexdelivery_Model_Shipping is not named in CamelCase.
        Open

        class Mygento_Yandexdelivery_Model_Shipping extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface
        {
        
            protected $_name = 'yandexdelivery';
            protected $_isFixed = false;

        CamelCaseClassName

        Since: 0.2

        It is considered best practice to use the CamelCase notation to name classes.

        Example

        class class_name {
        }

        Source

        The class Mygento_Yandexdelivery_Block_Adminhtml_Shipment_Grid is not named in CamelCase.
        Open

        class Mygento_Yandexdelivery_Block_Adminhtml_Shipment_Grid extends Mage_Adminhtml_Block_Widget_Grid
        {
        
            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 parameter $order_id is not named in camelCase.
        Open

            public function senderOrderStatuses($order_id) {
                return $this->sendRequest('getSenderOrderStatuses', ['order_id' => $order_id], true);
            }

        CamelCaseParameterName

        Since: 0.2

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

        Example

        class ClassName {
            public function doSomething($user_name) {
            }
        }

        Source

        The class Mygento_Yandexdelivery_Model_Resource_Warehouse_Collection is not named in CamelCase.
        Open

        class Mygento_Yandexdelivery_Model_Resource_Warehouse_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
        {
        
            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 class Mygento_Yandexdelivery_Model_Resource_Warehouse is not named in CamelCase.
        Open

        class Mygento_Yandexdelivery_Model_Resource_Warehouse extends Mage_Core_Model_Resource_Db_Abstract
        {
        
            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 property $_isFixed is not named in camelCase.
        Open

        class Mygento_Yandexdelivery_Model_Shipping extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface
        {
        
            protected $_name = 'yandexdelivery';
            protected $_isFixed = false;

        CamelCasePropertyName

        Since: 0.2

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

        Example

        class ClassName {
            protected $property_name;
        }

        Source

        The class Mygento_Yandexdelivery_Model_Source_Attribute is not named in CamelCase.
        Open

        class Mygento_Yandexdelivery_Model_Source_Attribute
        {
        
            public function getAllOptions()
            {

        CamelCaseClassName

        Since: 0.2

        It is considered best practice to use the CamelCase notation to name classes.

        Example

        class class_name {
        }

        Source

        Severity
        Category
        Status
        Source
        Language