Completed
Push — id3-metadata-objects ( c855dc...168cf3 )
by Daniel
03:05
created

Encoding   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 50
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 50
loc 50
ccs 0
cts 2
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A values() 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
 * This file is part of the ID3 project.
4
 *
5
 * @author Daniel Schröder <[email protected]>
6
 */
7
8
namespace GravityMedia\Metadata\ID3v2;
9
10
/**
11
 * ID3v2 encoding class.
12
 *
13
 * @package GravityMedia\Metadata\ID3v2
14
 */
15 View Code Duplication
class Encoding
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...
16
{
17
    /**
18
     * The ISO-8859-1 encoding.
19
     */
20
    const ISO_8859_1 = 0;
21
22
    /**
23
     * The UTF-16 Unicode encoding with BOM.
24
     * */
25
    const UTF_16 = 1;
26
27
    /**
28
     * The UTF-16BE Unicode encoding without BOM.
29
     */
30
    const UTF_16BE = 2;
31
32
    /**
33
     * The UTF-8 Unicode encoding.
34
     */
35
    const UTF_8 = 3;
36
37
    /**
38
     * The UTF-16LE Unicode encoding without BOM.
39
     * */
40
    const UTF_16LE = 4;
41
42
    /**
43
     * Valid values.
44
     *
45
     * @var int[]
46
     */
47
    protected static $values = [
48
        self::ISO_8859_1,
49
        self::UTF_16,
50
        self::UTF_16BE,
51
        self::UTF_8,
52
        self::UTF_16LE
53
    ];
54
55
    /**
56
     * Return valid values.
57
     *
58
     * @return int[]
59
     */
60
    public static function values()
61
    {
62
        return static::$values;
63
    }
64
}
65