Completed
Push — master ( 04f40e...f278b5 )
by Tobias
05:43
created

DescriptionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 75 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExtract() 9 9 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 the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Translation\Extractor\Tests\Functional\Visitor\Php;
13
14
use Translation\Extractor\Tests\Resources\Php\Symfony\DescriptionType;
15
use Translation\Extractor\Visitor\Php\Symfony\FormTypeLabelExplicit;
16
17
final class DescriptionTest extends BasePHPVisitorTest
18
{
19 View Code Duplication
    public function testExtract()
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...
20
    {
21
        $collection = $this->getSourceLocations(new FormTypeLabelExplicit(), DescriptionType::class);
22
23
        $this->assertCount(1, $collection);
24
        $source = $collection->first();
25
        $this->assertEquals('test_label', $source->getMessage());
26
        $this->assertEquals('Foobar:', $source->getContext()['desc']);
27
    }
28
}
29