HtmlBooleanAttributeRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 20
loc 20
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1
rs 10
ccs 4
cts 4
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAttributes() 8 8 2

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 ArjanSchouten\HtmlMinifier\Repositories;
4
5 View Code Duplication
class HtmlBooleanAttributeRepository extends AbstractRepository
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...
6
{
7
    protected static $attributes;
8
9
    /**
10
     * Get the html boolean attributes.
11
     *
12
     * @throws \ArjanSchouten\HtmlMinifier\Exception\FileNotFoundException
13
     *
14
     * @return \Illuminate\Support\Collection
15
     */
16 7
    public function getAttributes()
17
    {
18 7
        if (self::$attributes === null) {
19 1
            self::$attributes = $this->loadJson($this->resource('HtmlBooleanAttributes.json'))->attributes;
20
        }
21
22 7
        return self::$attributes;
23
    }
24
}
25