GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — master ( fd45eb...f91a4c )
by Dave
35:25 queued 16:23
created

Element   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 43
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 43
loc 43
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
A getText() 4 4 1
A setText() 4 4 1
A getTag() 4 4 1
A setTag() 4 4 1
A create() 4 4 1
A attributes() 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 SleepingOwl\Admin\Display;
4
5
use KodiComponents\Support\HtmlAttributes;
6
7 View Code Duplication
class Element
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...
8
{
9
    use HtmlAttributes;
10
11
    protected $text;
12
    protected $tag;
13
14
    public function __construct($text, $tag = 'span')
15
    {
16
        $this->text = $text;
17
        $this->tag = $tag;
18
    }
19
20
    public function getText()
21
    {
22
        return $this->text;
23
    }
24
25
    public function setText($text)
26
    {
27
        $this->text = $text;
28
    }
29
30
    public function getTag()
31
    {
32
        return $this->tag;
33
    }
34
35
    public function setTag($tag)
36
    {
37
        $this->tag = $tag;
38
    }
39
40
    public static function create($text)
41
    {
42
        return new static($text);
43
    }
44
45
    public function attributes()
46
    {
47
        return $this->htmlAttributesToString();
48
    }
49
}
50