Passed
Push — master ( 6407fd...37d291 )
by Gordon
04:05 queued 01:59
created

AddDuplicationCheckTask::run()   A

Complexity

Conditions 4
Paths 6

Size

Total Lines 39
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 23
c 1
b 0
f 0
nc 6
nop 1
dl 0
loc 39
rs 9.552

2 Methods

Rating   Name   Duplication   Size   Complexity  
A AddDuplicationCheckTask::getBeforeScript() 0 5 1
A AddDuplicationCheckTask::getScript() 0 3 1
1
<?php declare(strict_types = 1);
2
3
namespace Suilven\PHPTravisEnhancer;
4
5
use Suilven\PHPTravisEnhancer\Abstraction\TaskBase;
6
use Suilven\PHPTravisEnhancer\IFace\Task;
7
8
class AddDuplicationCheckTask extends TaskBase implements Task
9
{
10
    /** @return string bash variable for use in Travis script */
11
    public function getFlag(): string
12
    {
13
        return 'DUPLICATE_CODE_CHECK';
14
    }
15
16
17
    public function getBeforeScript(): ?string
18
    {
19
        return 'sudo apt remove -y nodejs && curl '
20
            . '-sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh && sudo bash nodesource_setup.sh '
21
            . '&& sudo apt install -y build-essential nodejs && which npm && npm install [email protected]';
22
    }
23
24
25
    public function getScript(): ?string
26
    {
27
        return 'node_modules/jscpd/bin/jscpd src && node_modules/jscpd/bin/jscpd tests';
28
    }
29
}
30