FolderSharingInfo   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 70
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 70
loc 70
ccs 6
cts 12
cp 0.5
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 1
A isReadOnly() 4 4 1
A getParentSharedFolderId() 4 4 1
A getSharedFolderId() 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
namespace Dropbox\Models;
3
4 View Code Duplication
class FolderSharingInfo extends BaseModel
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...
5
{
6
7
    /**
8
     * True if the file or folder is inside a read-only shared folder.
9
     *
10
     * @var bool
11
     */
12
    protected $read_only;
13
14
    /**
15
     * ID of shared folder that holds this folder.
16
     * Set if the folder is contained by a shared folder.
17
     *
18
     * @var string
19
     */
20
    protected $parent_shared_folder_id;
21
22
    /**
23
     * If this folder is a shared folder mount point,
24
     * the ID of the shared folder mounted at this location.
25
     *
26
     * @var string
27
     */
28
    protected $shared_folder_id;
29
30
31
    /**
32
     * Create a new Folder Sharing Info instance
33
     *
34
     * @param array $data
35
     */
36 1
    public function __construct(array $data)
37
    {
38 1
        parent::__construct($data);
39 1
        $this->read_only = $this->getDataProperty('read_only');
40 1
        $this->shared_folder_id = $this->getDataProperty('shared_folder_id');
41 1
        $this->parent_shared_folder_id = $this->getDataProperty('parent_shared_folder_id');
42 1
    }
43
44
    /**
45
     * True if the folder or folder is inside a read-only shared folder.
46
     *
47
     * @return bool
48
     */
49
    public function isReadOnly()
50
    {
51
        return $this->read_only;
52
    }
53
54
    /**
55
     * ID of shared folder that holds this folder.
56
     *
57
     * @return string
58
     */
59
    public function getParentSharedFolderId()
60
    {
61
        return $this->parent_shared_folder_id;
62
    }
63
64
    /**
65
     * ID of shared folder.
66
     *
67
     * @return string
68
     */
69
    public function getSharedFolderId()
70
    {
71
        return $this->shared_folder_id;
72
    }
73
}
74