Completed
Push — master ( bf487d...84f230 )
by Alessandro
10:10
created

Crap4j   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 27
loc 27
ccs 5
cts 5
cp 1
rs 10
c 1
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\OutputFile;
7
use Paraunit\Proxy\Coverage\CodeCoverage;
8
use SebastianBergmann\CodeCoverage\Report\Crap4j as PHPUnitCrap4j;
9
10
/**
11
 * Class Crap4jResult
12
 * @package Paraunit\Proxy\Coverage
13
 */
14 View Code Duplication
class Crap4j 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...
15
{
16
    /** @var PHPUnitCrap4j */
17
    private $crap4j;
18
19
    /** @var OutputFile */
20
    private $targetFile;
21
22
    /**
23
     * Crap4j constructor.
24
     * @param OutputFile $targetFile
25
     */
26 2
    public function __construct(OutputFile $targetFile)
27
    {
28 2
        $this->crap4j = new PHPUnitCrap4j();
29 2
        $this->targetFile = $targetFile;
30
    }
31
32
    /**
33
     * @param CodeCoverage $codeCoverage
34
     * @throws \RuntimeException
35
     */
36 1
    public function process(CodeCoverage $codeCoverage)
37
    {
38 1
        $this->crap4j->process($codeCoverage, $this->targetFile->getFilePath());
39
    }
40
}
41