Completed
Push — 4.0 ( 268f2c...88f012 )
by Hideki
05:48 queued 10s
created

PaymentManagePage   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 67
Duplicated Lines 13.43 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 9
loc 67
rs 10
c 0
b 0
f 0
wmc 9
lcom 1
cbo 1

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A go() 0 6 1
A at() 0 6 1
A 一覧_支払方法() 0 6 1
A 一覧_下に() 0 7 1
A 一覧_編集() 0 5 1
A 一覧_削除() 9 9 1
A 新規入力() 0 4 1
A 一覧_上に() 0 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
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.ec-cube.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Page\Admin;
15
16
class PaymentManagePage extends AbstractAdminPageStyleGuide
17
{
18
    public static $登録完了メッセージ = '.c-container .c-contentsArea div.alert-success';
19
20
    public function __construct(\AcceptanceTester $I)
21
    {
22
        parent::__construct($I);
23
    }
24
25
    public static function go($I)
26
    {
27
        $page = new self($I);
28
29
        return $page->goPage('/setting/shop/payment', '支払方法一覧店舗設定');
30
    }
31
32
    public static function at($I)
33
    {
34
        $page = new self($I);
35
36
        return $page->atPage('支払方法一覧店舗設定');
37
    }
38
39
    public function 一覧_支払方法($rowNum)
40
    {
41
        $rowNum = $rowNum + 1;
42
43
        return ".c-contentsArea__primaryCol .c-primaryCol .card-body ul li:nth-child(${rowNum})";
44
    }
45
46
    public function 一覧_下に($rowNum)
47
    {
48
        $rowNum = $rowNum + 1;
49
        $this->tester->click(".c-contentsArea__primaryCol .list-group-flush .list-group-item:nth-child(${rowNum}) .justify-content-around a.action-down ");
50
51
        return $this;
52
    }
53
54
    public function 一覧_編集($rowNum)
55
    {
56
        $rowNum = $rowNum + 1;
57
        $this->tester->click(".c-contentsArea__primaryCol .list-group-flush .list-group-item:nth-child(${rowNum})> div > div:nth-child(2) a ");
58
    }
59
60 View Code Duplication
    public function 一覧_削除($rowNum)
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...
61
    {
62
        $rowNum = $rowNum + 1;
63
        $this->tester->click(".c-contentsArea__primaryCol .list-group-flush .list-group-item:nth-child(${rowNum}) > div > div.col-3.text-right > div > a");
64
65
        // accept modal
66
        $this->tester->waitForElementVisible('#DeleteModal');
67
        $this->tester->click('#DeleteModal > div > div > div.modal-footer > a');
68
    }
69
70
    public function 新規入力()
71
    {
72
        $this->tester->click('.c-contentsArea__primaryCol  button.btn-ec-regular');
73
    }
74
75
    public function 一覧_上に($rowNum)
76
    {
77
        $rowNum = $rowNum + 1;
78
        $this->tester->click(".c-contentsArea__primaryCol .list-group-flush .list-group-item:nth-child(${rowNum}) .justify-content-around a.action-up ");
79
80
        return $this;
81
    }
82
}
83