Failed Conditions
Pull Request — experimental/sf (#3236)
by Kentaro
49:41 queued 37:58
created

CustomerAgreementSettingPage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 26
loc 26
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 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
4
namespace Page\Admin;
5
6
7
class CustomerAgreementSettingPage extends AbstractAdminPage
8
{
9
    public static $登録完了メッセージ = '#main .container-fluid div:nth-child(1) .alert-success';
10
11
    public function __construct(\AcceptanceTester $I)
12
    {
13
        parent::__construct($I);
14
    }
15
16
    public static function go($I)
17
    {
18
        $page = new self($I);
19
        return $page->goPage('/setting/shop/customer_agreement', 'ショップ設定利用規約管理');
20
    }
21
22
    public function 入力_会員規約($value)
23
    {
24
        $this->tester->fillField(['id' => 'customer_agreement_customer_agreement'], $value);
25
        return $this;
26
    }
27
28
    public function 登録()
29
    {
30
        $this->tester->click('#form1 #aside_column button');
31
    }
32
}