Completed
Push — master ( 3b67e2...2b6c0d )
by Matt
02:26
created

release_1_4_1_schema   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 68.97 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 20
loc 29
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A depends_on() 0 4 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
 * Precise Similar Topics
5
 *
6
 * @copyright (c) 2017 Matt Friedman
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace vse\similartopics\migrations;
12
13
class release_1_4_1_schema extends \phpbb\db\migration\migration
14
{
15
	static public function depends_on()
16
	{
17
		return array('\vse\similartopics\migrations\release_1_4_0_schema');
18
	}
19
20 View Code Duplication
	public function update_schema()
1 ignored issue
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...
21
	{
22
		return array(
23
			'change_columns'	=> array(
24
				$this->table_prefix . 'forums'	=> array(
25
					'similar_topic_forums'		=> array('MTEXT', null),
26
				),
27
			),
28
		);
29
	}
30
31 View Code Duplication
	public function revert_schema()
1 ignored issue
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...
32
	{
33
		return array(
34
			'change_columns'	=> array(
35
				$this->table_prefix . 'forums'	=> array(
36
					'similar_topic_forums'		=> array('MTEXT', ''),
37
				),
38
			),
39
		);
40
	}
41
}
42