GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 423fe8...f48289 )
by gyeong-won
15:56 queued 08:14
created

message   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 77
Duplicated Lines 67.53 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 52
loc 77
rs 10
c 0
b 0
f 0
wmc 12
lcom 0
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A moduleInstall() 0 4 1
B checkUpdate() 24 24 5
B moduleUpdate() 28 28 5
A recompileCache() 0 3 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
/* Copyright (C) NAVER <http://www.navercorp.com> */
3
/**
4
 * @class  message
5
 * @author NAVER ([email protected])
6
 * @brief high class of message module
7
 */
8
class message extends ModuleObject
9
{
10
	/**
11
	 * @brief Implement if additional tasks are necessary when installing
12
	 */
13
	function moduleInstall()
14
	{
15
		return new Object();
16
	}
17
18
	/**
19
	 * @brief a method to check if successfully installed
20
	 */
21 View Code Duplication
	function checkUpdate()
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...
22
	{
23
		$oModuleModel = getModel('module');
24
		$oModuleController = getController('module');
25
		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
26
		if($oModuleModel->needUpdate($version_update_id))
27
		{
28
			$config = $oModuleModel->getModuleConfig('message');
29
30
			if($config->skin)
31
			{
32
				$config_parse = explode('.', $config->skin);
33
				if (count($config_parse) > 1)
34
				{
35
					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
36
					if(is_dir($template_path)) return true;
37
				}
38
			}
39
40
			$oModuleController->insertUpdatedLog($version_update_id);
41
		}
42
43
		return false;
44
	}
45
46
	/**
47
	 * @brief Execute update
48
	 */
49 View Code Duplication
	function moduleUpdate()
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...
50
	{
51
		$oModuleModel = getModel('module');
52
		$oModuleController = getController('module');
53
		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
54
		if($oModuleModel->needUpdate($version_update_id))
55
		{
56
			$config = $oModuleModel->getModuleConfig('message');
57
58
			if($config->skin)
59
			{
60
				$config_parse = explode('.', $config->skin);
61
				if (count($config_parse) > 1)
62
				{
63
					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
64
					if(is_dir($template_path))
65
					{
66
						$config->skin = implode('|@|', $config_parse);
67
						$oModuleController = getController('module');
68
						$oModuleController->updateModuleConfig('message', $config);
69
					}
70
				}
71
			}
72
73
			$oModuleController->insertUpdatedLog($version_update_id);
74
		}
75
		return new Object();
76
	}
77
78
	/**
79
	 * @brief Re-generate the cache file
80
	 */
81
	function recompileCache()
82
	{
83
	}
84
}
85
/* End of file message.class.php */
86
/* Location: ./modules/message/message.class.php */
87