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

Invite   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A user() 4 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
namespace GiveBlood\Modules\User;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
8
use GiveBlood\Traits\UuidTrait;
9
use GiveBlood\Modules\Users\User;
10
11 View Code Duplication
class Invite extends Model
12
{
13
    use SoftDeletes, UuidTrait;
14
15
    protected $table = 'invites';
16
17
    protected $filliable = [ 'invite_code', 'user_id' ];
18
19
    protected $hidden = [ 'user_id', 'created_at', 'updated_at' ];
20
21
    protected $dates = [ 'created_at', 'updated_at' ];
22
23
    public function user()
24
    {
25
        return $this->belongsTo(User::class);
26
    }
27
}
28