Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Test Setup Failed
Pull Request — development (#68)
by José
06:06
created

BankServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 34
loc 34
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 6 6 1
A registerMigrations() 8 8 1
A registerFactories() 4 4 1
A registerSeeders() 8 8 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 GiveBlood\Modules\Bank\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Migrator\MigratorTrait as LaravelMigrator;
7
8
use GiveBlood\Modules\Bank\Database\Migrations\CreateBanksTable;
9
use GiveBlood\Modules\Bank\BankFactory;
10
use GiveBlood\Modules\Bank\Database\Seeders\BanksSeeder;
11
12
13 View Code Duplication
class BankServiceProvider extends ServiceProvider
14
{
15
    use LaravelMigrator;
16
17
    public function register()
18
    {
19
        $this->registerMigrations();
20
        $this->registerFactories();
21
        $this->registerSeeders();
22
    }
23
24
    public function registerMigrations()
25
    {
26
        $this->migrations(
27
            [
28
            CreateBanksTable::class
29
            ]
30
        );
31
    }
32
33
    public function registerFactories()
34
    {
35
        (new BankFactory())->define();
36
    }
37
38
    public function registerSeeders()
39
    {
40
        $this->seeders(
41
            [
42
                BanksSeeder::class
43
            ]
44
        );
45
    }
46
}
47