release_0_3_0_data   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 16
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A effectively_installed() 4 4 2
A update_data() 8 8 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 phpBB Extension - tas2580 Social Media Buttons
5
* @copyright (c) 2014 tas2580 (https://tas2580.net)
6
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7
*
8
*/
9
10
namespace tas2580\socialbuttons\migrations;
11
12 View Code Duplication
class release_0_3_0_data 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...
13
{
14
	public function effectively_installed()
15
	{
16
		return isset($this->config['socialbuttons_version']) && version_compare($this->config['socialbuttons_version'], '0.3.0', '>=');
17
	}
18
19
	public function update_data()
20
	{
21
		return array(
22
			// Add configs
23
			array('config.add', array('socialbuttons_style', '1')),
24
			array('config.add', array('socialbuttons_version', '0.3.0')),
25
		);
26
	}
27
}
28