Completed
Push — master ( b57ec8...24a4dc )
by Ricardo
03:57
created

ArquiteturaController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 33
loc 33
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A index() 21 21 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
namespace Fabrica\Http\Controllers\Painel;
4
5
use Fabrica\Models\Code\Field;
6
use Fabrica\Models\Code\Project;
7
8
use Fabrica\Models\Code\Wiki;
9
use Fabrica\Models\Infra\Container;
10
use Fabrica\Models\Infra\Domain;
11
12
13
use Fabrica\Services\FabricaService;
14
use Illuminate\Support\Facades\Schema;
15
16
17
use Informate\Models\Entytys\Fisicos\Weapon;
18
use Integrations\Models\Token;
19
use Population\Models\Features\Qa\Analyser;
20
21
22
use Telefonica\Models\Actors\Business;
23
use Telefonica\Models\Actors\Person;
24
25
26
27
use Telefonica\Models\Digital\Account;
28
29 View Code Duplication
class ArquiteturaController extends Controller
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...
30
{
31
    protected $service;
32
33
    public function __construct(FabricaService $service)
34
    {
35
        parent::__construct();
36
37
        $this->service = $service;
38
    }
39
40
    public function index()
41
    {
42
        // $service = $this->service;
43
44
        $service = new \Support\Services\RepositoryService(new \Support\Services\ModelService(Field::class));
45
        $registros = $service->getTableData();
46
        //     $teams = $this->repositoryService->paginated($request->user()->id);
47
48
        //Domain
49
        
50
51
        return view(
52
            'support::components.repositories.index',
53
            compact('service', 'registros')
54
        );
55
56
        // return view(
57
        //     'casa::finances.index',
58
        //     compact('service')
59
        // );
60
    }
61
}
62