Completed
Push — 4.0 ( b48f64...137622 )
by chihiro
20:21 queued 10s
created

BlockManagePage   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 32
loc 32
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A go() 6 6 1
A 新規入力() 4 4 1
A 編集() 4 4 1
A 削除() 4 4 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) LOCKON CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.lockon.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 BlockManagePage 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
    /**
19
     * BlockManagePage constructor.
20
     */
21
    public function __construct(\AcceptanceTester $I)
22
    {
23
        parent::__construct($I);
24
    }
25
26
    public static function go($I)
27
    {
28
        $page = new self($I);
29
30
        return $page->goPage('/content/block', 'ブロック管理コンテンツ管理');
31
    }
32
33
    public function 新規入力()
34
    {
35
        $this->tester->click('#page_admin_content_block > div.c-container > div.c-contentsArea > div.c-contentsArea__cols > div > div > div.row.justify-content-between.mb-2 > div.col-9 > a');
36
    }
37
38
    public function 編集($rowNum)
39
    {
40
        $this->tester->click("#page_admin_content_block > div > div.c-contentsArea > div.c-contentsArea__cols > div > div.c-primaryCol > div > div > div > ul > li:nth-child(${rowNum}) > div > div.col-auto.text-right > a:nth-child(1)");
41
    }
42
43
    public function 削除($rowNum)
44
    {
45
        $this->tester->click("#page_admin_content_block > div > div.c-contentsArea > div.c-contentsArea__cols > div > div.c-primaryCol > div > div > div > ul > li:nth-child(${rowNum}) > div > div.col-auto.text-right > a.btn.btn-ec-actionIcon.mr-3.disabled");
46
    }
47
}
48