Failed Conditions
Pull Request — experimental/sf (#3236)
by Kentaro
142:37 queued 134:37
created

PaymentEditPage   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 34
loc 34
rs 10
c 0
b 0
f 0
wmc 6
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 PaymentEditPage extends AbstractAdminPageStyleGuide
8
{
9
    public function __construct(\AcceptanceTester $I)
10
    {
11
        parent::__construct($I);
12
    }
13
14
    public static function at($I)
15
    {
16
        $page = new self($I);
17
        return $page->atPage('支払方法登録・編集基本情報設定');
18
    }
19
20
    public function 入力_支払方法($value) {
21
        $this->tester->fillField(['id' => 'payment_register_method'], $value);
22
        return $this;
23
    }
24
25
    public function 入力_手数料($value) {
26
        $this->tester->fillField(['id' => 'payment_register_charge'], $value);
27
        return $this;
28
    }
29
30
    public function 入力_利用条件下限($value) {
31
        $this->tester->fillField(['id' => 'payment_register_rule_min'], $value);
32
        return $this;
33
    }
34
35
    public function 登録()
36
    {
37
        $this->tester->click('#form1 > .c-conversionArea > .c-conversionArea__container button.btn-ec-conversion');
38
    }
39
40
}