DataValidations   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getData() 18 18 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 Xls\Record;
4
5 View Code Duplication
class DataValidations 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...
6
{
7
    const NAME = 'DATAVALIDATIONS';
8
    const ID = 0x01B2;
9
10
    /**
11
     * Generate the DVAL biff record
12
     * @param $dv
13
     *
14
     * @return string
15
     */
16
    public function getData($dv)
17
    {
18
        $grbit = 0x02; // Prompt box at cell, no cached validity data at DV records
19
        $horPos = 0x00; // Horizontal position of prompt box, if fixed position
20
        $verPos = 0x00; // Vertical position of prompt box, if fixed position
21
        $objId = 0xffffffff; // Object identifier of drop down arrow object, or -1 if not visible
22
23
        $data = pack(
24
            'vVVVV',
25
            $grbit,
26
            $horPos,
27
            $verPos,
28
            $objId,
29
            count($dv)
30
        );
31
32
        return $this->getFullRecord($data);
33
    }
34
}
35