Completed
Push — master ( f606cd...f6df63 )
by
unknown
03:49 queued 02:25
created

Transition   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getWorkflow() 3 3 1
A state() 4 4 1
A stateFrom() 4 4 1
A stateTo() 4 4 1
A vueGuard() 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 Bantenprov\VueWorkflow\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
use Emadadly\LaravelUuid\Uuids;
8
9 View Code Duplication
class Transition extends Model
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 SoftDeletes;
12
    use Uuids;
13
    
14
    public $table = 'workflow_transition';
15
16
    public $fillable = ['workflow_id','name','label','message','from','to'];
17
18
    public function getWorkflow(){
19
        return $this->belongsTo('Bantenprov\VueWorkflow\Models\Workflow','workflow_id');
20
    }
21
22
    public function state()
23
    {
24
        return $this->belongsTo('Bantenprov\VueWorkflow\Models\State','to','id');
25
    }
26
27
    public function stateFrom()
28
    {
29
        return $this->belongsTo('Bantenprov\VueWorkflow\Models\State','from','id');
30
    }
31
32
    public function stateTo()
33
    {
34
        return $this->belongsTo('Bantenprov\VueWorkflow\Models\State','to','id');
35
    }
36
37
    public function vueGuard()
38
    {
39
        return $this->hasOne('Bantenprov\VueGuard\Models\VueGuardModel','transition_id');
40
    }
41
}
42