Panel   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 55
Duplicated Lines 100 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 0
Metric Value
wmc 11
lcom 2
cbo 1
dl 55
loc 55
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setTitle() 3 3 1
A setHeader() 3 3 1
A addTool() 3 3 1
A addDockedItem() 3 3 1
A setDockedItems() 6 6 2
A setCollapsible() 3 3 1
A setButtons() 6 6 2
A getButtons() 3 3 1
A addButton() 3 3 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 Ext\Panel;
3
4
5
use Ext\Container\Container;
6
7 View Code Duplication
class Panel extends Container
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...
8
{
9
	public function setTitle($title){
10
		return $this->setProperty('title',$title);
11
	}
12
13
	public function setHeader(Header $header){
14
		return  $this->setProperty('header',$header);
15
	}
16
17
	public function addTool(Tool $tool){
18
		return $this->add('tools',$tool);
19
	}
20
21
	public function addDockedItem($dockedItem){
22
		return $this->add('dockedItems',$dockedItem);
23
	}
24
25
	public function setDockedItems(array $dockedItems){
26
		foreach($dockedItems as $dockedItem){
27
			$this->addDockedItem($dockedItem);
28
		}
29
		return $this;
30
	}
31
32
33
	/**
34
	 * True to make the panel collapsible and have an expand/collapse toggle Tool added into the header tool button area.
35
	 * @param bool $collapsible
36
	 * @return $this
37
	 */
38
	public function setCollapsible($collapsible){
39
		return $this->setProperty('collapsible',(bool)$collapsible);
40
	}
41
	
42
	public function setButtons(array $buttons){
43
		foreach($buttons as $button){
44
			$this->addButton($button);
45
		}
46
		return $this;
47
	}
48
49
	public function getButtons(){
50
		return $this->getProperty('buttons');
51
	}
52
53
	public function addButton($button){
54
		return $this->add('buttons',$button);
55
	}
56
	
57
	
58
59
60
61
}
62