ExampleRow   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 1
dl 24
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 1
A getName() 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 Saxulum\PhpDocGenerator;
4
5
/**
6
 * @link http://www.phpdoc.org/docs/latest/references/phpdoc/tags/example.html
7
 */
8 View Code Duplication
class ExampleRow extends AbstractRow
9
{
10
    /**
11
     * @param string      $location
12
     * @param int|null    $startLine
13
     * @param int|null    $numberOfLines
14
     * @param string|null $description
15
     */
16
    public function __construct($location, $startLine = null, $numberOfLines = null, $description = null)
17
    {
18
        $this->addPart($location);
19
        $this->addPart($startLine);
20
        $this->addPart($numberOfLines);
21
        $this->addPart($description);
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    public function getName()
28
    {
29
        return 'example';
30
    }
31
}
32