Completed
Pull Request — master (#113)
by Jakub
18:13
created

m13_hide_on_noncontent_pages   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A effectively_installed() 4 4 1
A depends_on() 4 4 1
A update_data() 6 6 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
 * Advertisement management. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2017 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\ads\migrations\v10x;
12
13 View Code Duplication
class m13_hide_on_noncontent_pages extends \phpbb\db\migration\migration
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...
14
{
15
	/**
16
	 * {@inheritDoc}
17
	 */
18
	public function effectively_installed()
19
	{
20
		return $this->config->offsetExists('phpbb_ads_hide_on_noncontent');
21
	}
22
23
	/**
24
	 * {@inheritDoc}
25
	 */
26
	public static function depends_on()
27
	{
28
		return array('\phpbb\ads\migrations\v10x\m1_initial_schema');
29
	}
30
31
	/**
32
	 * Add phpbb_ads_hide_on_noncontent config
33
	 *
34
	 * @return array Array of data update instructions
35
	 */
36
	public function update_data()
37
	{
38
		return array(
39
			array('config.add', array('phpbb_ads_hide_on_noncontent', 0)),
40
		);
41
	}
42
}
43