Completed
Push — master ( 9a7b87...ad20a3 )
by Alessandro
03:07
created

Xml   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 27
loc 27
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
A process() 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
declare(strict_types=1);
3
4
namespace Paraunit\Coverage\Processor;
5
6
use Paraunit\Configuration\OutputPath;
7
use Paraunit\Proxy\Coverage\CodeCoverage;
8
use PHPUnit\Runner\Version;
9
use SebastianBergmann\CodeCoverage\Report\Xml\Facade;
10
11
/**
12
 * Class XMLResult
13
 * @package Paraunit\Proxy\Coverage
14
 */
15 View Code Duplication
class Xml implements CoverageProcessorInterface
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...
16
{
17
    /** @var  Facade */
18
    private $xml;
19
20
    /** @var  OutputPath */
21
    private $targetPath;
22
23
    /**
24
     * Xml constructor.
25
     * @param OutputPath $targetPath
26
     */
27
    public function __construct(OutputPath $targetPath)
28
    {
29
        $this->xml = new Facade(Version::id());
30
        $this->targetPath = $targetPath;
31
    }
32
33
    /**
34
     * @param CodeCoverage $codeCoverage
35
     * @throws \RuntimeException
36
     */
37
    public function process(CodeCoverage $codeCoverage)
38
    {
39
        $this->xml->process($codeCoverage, $this->targetPath->getPath());
40
    }
41
}
42