Completed
Push — master ( 9901a6...4d46a6 )
by Fumio
03:38
created

SeederMakeCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 2
Metric Value
c 4
b 0
f 2
dl 41
loc 41
ccs 6
cts 6
cp 1
rs 10
wmc 3
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A getDefaultNamespace() 4 4 2

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
namespace LaravelPlus\Extension\Database\Console;
4
5
use Jumilla\Versionia\Laravel\Console\SeederMakeCommand as BaseCommand;
6
use LaravelPlus\Extension\Addons\Addon;
7
use LaravelPlus\Extension\Generators\GeneratorCommandTrait;
8
9 View Code Duplication
class SeederMakeCommand extends BaseCommand
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...
10
{
11
    use GeneratorCommandTrait;
12
13
    /**
14
     * The console command singature.
15
     *
16
     * @var stringphp
17
     */
18
    protected $signature = 'make:seeder
19
        {name : The name of the class}
20
        {--a|addon= : The name of the addon}
21
    ';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = '[+] Create a new seeder class';
29
30
    /**
31
     * The constructor.
32
     */
33 5
    public function __construct()
34
    {
35 5
        parent::__construct();
36
37 5
        $this->setStubDirectory(__DIR__.'/../stubs');
38 5
    }
39
40
    /**
41
     * Get the default namespace for the class.
42
     *
43
     * @return string
44
     */
45 2
    protected function getDefaultNamespace()
46
    {
47 2
        return $this->getRootNamespace().'\\'.($this->onAddon() ? 'Seeds' : 'Database\\Seeds');
48
    }
49
}
50