v110   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 48.78 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 0
cbo 0
dl 20
loc 41
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A depends_on() 0 4 1
A effectively_installed() 0 4 2
A update_data() 0 6 1
A update_schema() 10 10 1
A revert_schema() 10 10 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
 *
4
 * @package Quick Title Edition Extension
5
 * @copyright (c) 2015 ABDev
6
 * @copyright (c) 2015 PastisD
7
 * @copyright (c) 2015 Geolim4 <http://geolim4.com>
8
 * @copyright (c) 2015 Zoddo <[email protected]>
9
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
10
 *
11
 */
12
13
namespace ernadoo\qte\migrations\v11x;
14
15
class v110 extends \phpbb\db\migration\migration
16
{
17
	static public function depends_on()
18
	{
19
		return array('\ernadoo\qte\migrations\v100\gold');
20
	}
21
22
	public function effectively_installed()
23
	{
24
		return isset($this->config['qte_version']) && phpbb_version_compare($this->config['qte_version'], '1.1.0', '>=');
25
	}
26
27
	public function update_data()
28
	{
29
		return array(
30
			array('config.update', array('qte_version', '1.1.0')),
31
		);
32
	}
33
34 View Code Duplication
	public function update_schema()
35
	{
36
		return array(
37
			'update_columns'	   => array(
38
				$this->table_prefix . 'topics_attr'		=> array(
39
					array('attr_desc', array('VCHAR:60', '')),
40
				),
41
			),
42
		);
43
	}
44
45 View Code Duplication
	public function revert_schema()
0 ignored issues
show
Duplication introduced by
This method 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...
46
	{
47
		return array(
48
			'update_columns'	   => array(
49
				$this->table_prefix . 'topics_attr'		=> array(
50
					array('attr_desc', array('VCHAR', '')),
51
				),
52
			),
53
		);
54
	}
55
}
56