Mygento_Yandexdelivery_Model_Observer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleSave() 0 21 3
1
<?php
2
3
/**
4
 *
5
 *
6
 * @category Mygento
7
 * @package Mygento_Yandexdelivery
8
 * @copyright 2017 NKS LLC. (http://www.mygento.ru)
9
 * @license GPLv2
10
 */
11
class Mygento_Yandexdelivery_Model_Observer extends Varien_Object
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
12
{
13
14
    public function handleSave()
15
    {
16
17
        if (Mage::getStoreConfig('carriers/yandexdelivery/active')) {
18
            //process keys
19
            $keys_data = Mage::getStoreConfig('carriers/yandexdelivery/keys');
20
            Mage::getModel('yandexdelivery/carrier')->processApiKeys($keys_data);
21
22
            //process ids
23
            $ids_data = Mage::getStoreConfig('carriers/yandexdelivery/ids');
24
            Mage::getModel('yandexdelivery/carrier')->processApiIds($ids_data);
25
26
            //очистка кешей
27
            if (Mage::getStoreConfig('carriers/yandexdelivery/flush')) {
28
                Mage::helper('yandexdelivery')->refreshAllCaches();
29
            }
30
31
            //currently unused
32
            //Mage::getModel('yandexdelivery/carrier')->getPaymentMethods();
0 ignored issues
show
Unused Code Comprehensibility introduced by
73% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
33
        }
34
    }
35
}
36