Completed
Push — master ( 01b9e4...761718 )
by Yaroslav
02:28 queued 12s
created

CategoryAdminTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 85.71 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 24
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConfigureListFields() 13 13 1
A testConfigureFormFields() 11 11 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
declare(strict_types=1);
4
5
namespace Harentius\BlogBundle\Tests\Unit\Admin\Admin;
6
7
use Harentius\BlogBundle\Admin\Admin\CategoryAdmin;
8
use Harentius\BlogBundle\Test\SonataAdminClassTestCase;
9
10
class CategoryAdminTest extends SonataAdminClassTestCase
11
{
12 View Code Duplication
    public function testConfigureListFields(): void
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...
13
    {
14
        $articleAdmin = $this->createAdmin(CategoryAdmin::class);
15
        $this->assertHasListFields($articleAdmin, [
16
            'name',
17
            'slug',
18
            'parent',
19
            'children',
20
            'metaDescription',
21
            'metaKeywords',
22
            '_action',
23
        ]);
24
    }
25
26 View Code Duplication
    public function testConfigureFormFields(): void
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...
27
    {
28
        $articleAdmin = $this->createAdmin(CategoryAdmin::class);
29
        $this->assertHasFormFields($articleAdmin, [
30
            'name',
31
            'slug',
32
            'parent',
33
            'metaDescription',
34
            'metaKeywords',
35
        ]);
36
    }
37
}
38