LimeSoda_LiveGuard_Model_Observer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A controllerFrontInitBefore() 0 14 3
1
<?php
2
3
class LimeSoda_LiveGuard_Model_Observer
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...
4
{
5
    /**
6
     * @SuppressWarnings("UnusedFormalParameter")
7
     * @param Varien_Event_Observer $observer
8
     * @return LimeSoda_LiveGuard_Model_Observer
9
     */
10
    public function controllerFrontInitBefore(Varien_Event_Observer $observer)
0 ignored issues
show
Unused Code introduced by
The parameter $observer is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
11
    {
12
        $config = Mage::getModel('limesoda_liveguard/config');
13
        
14
        if (!$config->configExists()) {
15
            return $this;
16
        }
17
        
18
        foreach ($config->getGuards() as $guard) {
19
                $guard->process();
20
        }
21
        
22
        return $this;
23
    }
24
}
25