Passed
Push — master ( d95e49...7c87fb )
by Andrés
39s
created

AbstractSymfonyTask   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 57.89 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 11
loc 19
ccs 10
cts 10
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOptions() 11 11 1
A getSymfonyOptions() 0 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
/*
3
 * This file is part of the Magallanes package.
4
 *
5
 * (c) Andrés Montañez <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Mage\Task\BuiltIn\Symfony;
12
13
use Mage\Task\AbstractTask;
14
15
/**
16
 * Abstract Symfony Task
17
 *
18
 * @author Andrés Montañez <[email protected]>
19
 */
20
abstract class AbstractSymfonyTask extends AbstractTask
21
{
22 10 View Code Duplication
    protected function getOptions()
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...
23
    {
24 10
        $options = array_merge(
25 10
            ['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
26 10
            $this->getSymfonyOptions(),
27 10
            $this->runtime->getMergedOption('symfony'),
28 10
            $this->options
29 10
        );
30
31 10
        return $options;
32
    }
33
34 10
    protected function getSymfonyOptions()
35
    {
36 10
        return [];
37
    }
38
}
39