Failed Conditions
Pull Request — 4.0 (#4805)
by chihiro
06:02
created

ProductCsvUploadPage   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 47
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 47
loc 47
rs 10
c 0
b 0
f 0
wmc 6
lcom 0
cbo 1

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A go() 6 6 1
A 入力_CSVファイル() 6 6 1
A モーダル表示() 6 6 1
A CSVアップロード実行() 6 6 1
A 雛形ダウンロード() 6 6 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 View Code Duplication
class ProductCsvUploadPage extends AbstractAdminPageStyleGuide
0 ignored issues
show
Duplication introduced by
This class 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...
17
{
18
    public static $完了メッセージ = '#importCsvModal > div > div > div.modal-body.text-left > p';
19
20
    /**
21
     * ProductCsvUploadPage constructor.
22
     */
23
    public function __construct(\AcceptanceTester $I)
24
    {
25
        parent::__construct($I);
26
    }
27
28
    public static function go($I)
29
    {
30
        $page = new ProductCsvUploadPage($I);
31
32
        return $page->goPage('/product/product_csv_upload', '商品CSV登録商品管理');
33
    }
34
35
    public function 入力_CSVファイル($fileName)
36
    {
37
        $this->tester->attachFile(['id' => 'admin_csv_import_import_file'], $fileName);
38
39
        return $this;
40
    }
41
42
    public function モーダル表示()
43
    {
44
        $this->tester->click(['id' => 'upload-button']);
45
46
        return $this;
47
    }
48
49
    public function CSVアップロード実行()
50
    {
51
        $this->tester->click(['id' => 'importCsv']);
52
53
        return $this;
54
    }
55
56
    public function 雛形ダウンロード()
57
    {
58
        $this->tester->click('#download-button');
59
60
        return $this;
61
    }
62
}
63