Completed
Push — master ( 2289fe...fc9f33 )
by Scott
02:28
created

Customers   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php namespace Bedard\Shop\Controllers;
2
3
use BackendMenu;
4
use Bedard\Shop\Classes\BackendController;
5
6
/**
7
 * Customers Back-end Controller.
8
 */
9 View Code Duplication
class Customers extends BackendController
10
{
11
    public $formConfig = 'config_form.yaml';
12
13
    public $listConfig = 'config_list.yaml';
14
15
    public $implement = [
16
        'Backend.Behaviors.FormController',
17
        'Backend.Behaviors.ListController',
18
        'Owl.Behaviors.ListDelete.Behavior',
19
    ];
20
21
    public $registerPermissions = [
22
        'bedard.shop.customers.manage',
23
    ];
24
25
    public function __construct()
26
    {
27
        parent::__construct();
28
29
        BackendMenu::setContext('Bedard.Shop', 'shop', 'customers');
30
        $this->addJs('/plugins/bedard/shop/assets/dist/customers.js');
31
    }
32
}
33