CountryPrice_EcomDBConfig   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 50 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 11 11 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
2
3
class CountryPrice_EcomDBConfig extends DataExtension
4
{
5
    private static $db = array(
6
        'NoProductsInYourCountry' => 'HTMLText'
7
    );
8
9
    /**
10
     * Update Fields
11
     * @return FieldList
12
     */
13 View Code Duplication
    public function updateCMSFields(FieldList $fields)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
    {
15
        $fields->addFieldsToTab(
16
            'Root.Products',
17
            array(
18
                $field = HTMLEditorField::create('NoProductsInYourCountry', 'Message shown when there are no products available in your country.')
19
            )
20
        );
21
        $field->setRows(7);
22
        return $fields;
23
    }
24
}
25