Failed Conditions
Push — experimental/sf ( 069d05...1f2df0 )
by chihiro
157:56 queued 150:35
created

ShippingManagePage   A

Complexity

Total Complexity 19

Size/Duplication

Total Lines 138
Duplicated Lines 28.99 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 0
Metric Value
dl 40
loc 138
rs 10
c 0
b 0
f 0
wmc 19
lcom 2
cbo 1

19 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A go() 0 5 1
A at() 0 5 1
A 検索() 0 6 1
A 入力_ご注文者お名前() 0 5 1
A 入力_ご注文者お名前フリガナ() 0 5 1
A 詳細検索_電話番号() 8 8 1
A 出荷CSVダウンロード実行() 0 5 1
A 出荷CSV出力項目設定() 0 5 1
A 一覧_編集() 0 4 1
A 一覧_削除() 8 8 1
A 一覧_削除キャンセル() 0 6 1
A 一括発送済み更新() 9 9 1
A 一括発送済みメール送信() 8 8 1
A 一覧_全選択() 0 5 1
A その他メニュー() 0 4 1
A メール一括通知() 0 4 1
A 一覧_チェックボックス() 0 4 1
A 詳細検索設定() 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
2
3
namespace Page\Admin;
4
5
6
class ShippingManagePage extends AbstractAdminPageStyleGuide
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
7
{
8
    public static $検索結果_メッセージ = '#search_form > div.c-outsideBlock__contents.mb-3 > span';
0 ignored issues
show
Coding Style introduced by
Member variable "検索結果_メッセージ" is not in valid camel caps format
Loading history...
9
    public static $検索結果_エラーメッセージ = '//*[@id="page_admin_shipping"]/div[1]/div[3]/div[3]/div/div[1]/div/div/div[1]';
0 ignored issues
show
Coding Style introduced by
Member variable "検索結果_エラーメッセージ" is not in valid camel caps format
Loading history...
10
    public static $詳細検索ボタン = '//*[@id="search_form"]/div[1]/div/div/div[2]/a/span';
0 ignored issues
show
Coding Style introduced by
Member variable "詳細検索ボタン" is not in valid camel caps format
Loading history...
11
12
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$I" missing
Loading history...
13
     * ShippingListPage constructor.
14
     */
15
    public function __construct(\AcceptanceTester $I)
16
    {
17
        parent::__construct($I);
18
    }
19
20
    public static function go(\AcceptanceTester $I)
21
    {
22
        $page = new self($I);
23
        return $page->goPage('/shipping', '出荷一覧出荷管理');
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
24
    }
25
26
    public static function at(\AcceptanceTester $I)
27
    {
28
        $page = new self($I);
29
        return $page->atPage('出荷管理出荷一覧');
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
30
    }
31
32
    public function 検索($value = '')
0 ignored issues
show
Coding Style introduced by
Method name "ShippingManagePage::検索" is not in camel caps format
Loading history...
33
    {
34
        $this->tester->fillField(['id' => 'admin_search_shipping_multi'], $value);
35
        $this->tester->click('#search_form > div.c-outsideBlock__contents.mb-3 > button');
36
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
37
    }
38
39 View Code Duplication
    public function 詳細検索設定()
0 ignored issues
show
Coding Style introduced by
Method name "ShippingManagePage::詳細検索設定" is not in camel caps format
Loading history...
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...
40
    {
41
        $this->tester->click(self::$詳細検索ボタン);
42
        $this->tester->waitForElementVisible(['id' => 'searchDetail']);
43
        $this->tester->wait(0.5);
44
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
45
    }
46
47
    public function 入力_ご注文者お名前($value)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingManagePage::入力_ご注文者お名前" is not in camel caps format
Loading history...
48
    {
49
        $this->tester->fillField(['id' => 'admin_search_shipping_order_name'], $value);
50
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
51
    }
52
53
    public function 入力_ご注文者お名前フリガナ($value)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingManagePage::入力_ご注文者お名前フリガナ" is not in camel caps format
Loading history...
54
    {
55
        $this->tester->fillField(['id' => 'admin_search_shipping_order_kana'], $value);
56
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
57
    }
58
59 View Code Duplication
    public function 詳細検索_電話番号($value = '')
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...
Coding Style introduced by
Method name "ShippingManagePage::詳細検索_電話番号" is not in camel caps format
Loading history...
60
    {
61
        $this->tester->click(self::$詳細検索ボタン);
62
        $this->tester->wait(1);
63
        $this->tester->fillField(['id' => 'admin_search_shipping_phone_number'], $value);
64
        $this->tester->click('#search_form > div.c-outsideBlock__contents.mb-3 > button');
65
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
66
    }
67
68
    public function 出荷CSVダウンロード実行()
0 ignored issues
show
Coding Style introduced by
Method name "ShippingManagePage::出荷CSVダウンロード実行" is not in camel caps format
Loading history...
69
    {
70
        $this->tester->click(['xpath' => '//*[@id="form_bulk"]/div[1]/div[2]/div[2]/div/a[1]']);
71
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
72
    }
73
74
    public function 出荷CSV出力項目設定()
0 ignored issues
show
Coding Style introduced by
Method name "ShippingManagePage::出荷CSV出力項目設定" is not in camel caps format
Loading history...
75
    {
76
        $this->tester->click(['xpath' => '//*[@id="form_bulk"]/div[1]/div[2]/div[2]/div/a[2]']);
77
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
78
    }
79
80
    public function 一覧_編集($rowNum)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingManagePage::一覧_編集" is not in camel caps format
Loading history...
81
    {
82
        $this->tester->click(['xpath' => "//*[@id='form_bulk']/div[2]/div/table/tbody/tr[${rowNum}]/td[2]/a"]);
83
    }
84
85 View Code Duplication
    public function 一覧_削除()
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...
Coding Style introduced by
Method name "ShippingManagePage::一覧_削除" is not in camel caps format
Loading history...
86
    {
87
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[3]']);
88
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[3]']);
89
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk_delete"]']);
90
        $this->tester->click(['xpath' => '//*[@id="btn_bulk_delete"]']);
91
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
92
    }
93
94
    public function 一覧_削除キャンセル()
0 ignored issues
show
Coding Style introduced by
Method name "ShippingManagePage::一覧_削除キャンセル" is not in camel caps format
Loading history...
95
    {
96
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
97
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
98
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
99
    }
100
101 View Code Duplication
    public function 一括発送済み更新()
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...
Coding Style introduced by
Method name "ShippingManagePage::一括発送済み更新" is not in camel caps format
Loading history...
102
    {
103
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[2]']);
104
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[2]']);
105
        $this->tester->wait(3);
106
        $this->tester->click(['id' => 'notificationMail']);
107
        $this->tester->click(['id' => 'bulkChange']);
108
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
109
    }
110
111 View Code Duplication
    public function 一括発送済みメール送信()
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...
Coding Style introduced by
Method name "ShippingManagePage::一括発送済みメール送信" is not in camel caps format
Loading history...
112
    {
113
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
114
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
115
        $this->tester->wait(3);
116
        $this->tester->click(['id' => 'bulkChange']);
117
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
118
    }
119
120
    public function 一覧_全選択()
0 ignored issues
show
Coding Style introduced by
Method name "ShippingManagePage::一覧_全選択" is not in camel caps format
Loading history...
121
    {
122
        $this->tester->checkOption(['id' => 'check-all']);
123
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
124
    }
125
126
    /**
127
     * TODO: Should remove this function due to new design does not have other dropdown menu
128
     */
129
    private function その他メニュー()
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
Coding Style introduced by
Method name "ShippingManagePage::その他メニュー" is not in camel caps format
Loading history...
130
    {
131
        $this->tester->click('#dropmenu > a');
132
    }
133
134
    public function メール一括通知()
0 ignored issues
show
introduced by
Declare public methods first, then protected ones and finally private ones
Loading history...
Coding Style introduced by
Method name "ShippingManagePage::メール一括通知" is not in camel caps format
Loading history...
135
    {
136
        $this->tester->click('#form_bulk #btn_bulk_mail');
137
    }
138
139
    public function 一覧_チェックボックス($rowNum)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingManagePage::一覧_チェックボックス" is not in camel caps format
Loading history...
140
    {
141
        $this->tester->click(['xpath' => "//*[@id='form_bulk']/div[2]/div/table/tbody/tr[${rowNum}]/td[1]/input"]);
142
    }
143
}
144