Note   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getData() 9 9 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
namespace Xls\Record;
3
4
use Xls\StringUtils;
5
6 View Code Duplication
class Note extends AbstractRecord
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...
7
{
8
    const NAME = 'NOTE';
9
    const ID = 0x001C;
10
11
    /**
12
     * Generate a note associated with the cell given by the row and column.
13
     * NOTE records don't have a length limit
14
     * @param integer $row
15
     * @param integer $col
16
     * @param integer $objId
17
     *
18
     * @return string
19
     */
20
    public function getData($row, $col, $objId)
21
    {
22
        $grbit = 0x00;
23
        $data = pack("vvvv", $row, $col, $grbit, $objId);
24
        $author = 'xls-writer';
25
        $data .= StringUtils::toBiff8UnicodeLong($author);
26
27
        return $this->getFullRecord($data);
28
    }
29
}
30