Completed
Push — master ( 9f3eac...f0c1b5 )
by David
02:49 queued 13s
created

Reload_Data_Page   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 32
loc 32
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 11 11 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
 * Sets up the admin page for the plaats enhance features where the updater
5
 * process can be triggered.
6
 *
7
 * @link       https://wordlift.io
8
 * @since      1.0.0
9
 *
10
 * @package    Wordlift_Framework\Tasks\Admin
11
 */
12
13
namespace Wordlift\Images_Licenses\Tasks;
14
15
use Wordlift\Tasks\Admin\Tasks_Page_Base;
16
use Wordlift\Tasks\Task_Ajax_Adapters_Registry;
17
18 View Code Duplication
class Reload_Data_Page extends Tasks_Page_Base {
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...
19
20
	/**
21
	 * The ID of this admin page.
22
	 *
23
	 * @since    1.0.0
24
	 * @access   private
25
	 * @var      string $menu_slug The ID of this page.
26
	 */
27
	private $menu_slug = 'wl_images_licenses__reload_data';
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
28
29
	/**
30
	 * Define the {@link Wordlift_Admin_Page} constructor.
31
	 *
32
	 * @param Task_Ajax_Adapters_Registry $task_ajax_adapters_registry
33
	 * @param string $version
34
	 *
35
	 * @since 1.0.0
36
	 */
37
	public function __construct( $task_ajax_adapters_registry, $version ) {
38
		parent::__construct(
39
			$task_ajax_adapters_registry,
40
			$version,
41
			$this->menu_slug,
42
			__( 'License Compliance', 'wordlift-framework' ),
43
			'manage_options',
44
			null,
45
			__( 'License Compliance', 'wordlift-framework' )
46
		);
47
	}
48
49
}
50