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 ( 278e53...818459 )
by gyeong-won
39:17 queued 30:14
created

syndicationAdminController   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 3 1
D procSyndicationAdminInsertConfig() 0 43 10
B procSyndicationAdminCheckPingResult() 0 26 4
1
<?php
2
/* Copyright (C) NAVER <http://www.navercorp.com> */
3
4
/**
5
 * @class  syndicationAdminController
6
 * @author NAVER ([email protected])
7
 * @brief syndication module admin Controller class
8
 **/
9
10
class syndicationAdminController extends syndication {
11
12
	function init() 
13
	{
14
	}
15
16
	function procSyndicationAdminInsertConfig() 
17
	{
18
		$oModuleController = getController('module');
19
		$oSyndicationController = getController('syndication');
0 ignored issues
show
Unused Code introduced by
$oSyndicationController is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
20
		$oSyndicationModel = getModel('syndication');
0 ignored issues
show
Unused Code introduced by
$oSyndicationModel is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
21
22
		$config = new stdClass;
23
		$config->syndication_use = Context::get('syndication_use');
24
		$config->site_url = preg_replace('/\/+$/is','',Context::get('site_url'));
25
		$config->year = Context::get('year');
26
		$config->syndication_token = Context::get('syndication_token');
27
		$config->syndication_password = urlencode(Context::get('syndication_password'));
28
29
		if(!$config->site_url) return $this->makeObject(-1,'msg_site_url_is_null');
30
		if(!$config->syndication_token) return $this->makeObject(-1,'msg_syndication_token_is_null');
31
32
		$oModuleController->updateModuleConfig('syndication',$config);
33
34
		$except_module = Context::get('except_module');
35
		$output = executeQuery('syndication.deleteExceptModules');
36
		if(!$output->toBool()) return $output;
37
38
		if ($except_module){
39
			$modules = explode(',',$except_module);
40
			for($i=0,$c=count($modules);$i<$c;$i++) {
41
				$args->module_srl = $modules[$i];
0 ignored issues
show
Bug introduced by
The variable $args does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
42
				$output = executeQuery('syndication.insertExceptModule',$args);
43
				if(!$output->toBool()) return $output;
44
			}
45
		}
46
47
		if(!$this->checkOpenSSLSupport())
48
		{
49
			return $this->makeObject(-1, 'msg_need_openssl_support');
50
		}
51
52
		$this->setMessage('success_applied');
53
		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
54
			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSyndicationAdminConfig');
55
			$this->setRedirectUrl($returnUrl);
56
			return;
57
		}
58
	}
59
60
	function procSyndicationAdminCheckPingResult()
61
	{
62
		$oModuleModel = getModel('module');
63
64
		$oSyndicationController = getController('syndication');
65
		$oSyndicationModel= getModel('syndication');
66
67
		$module_config = $oModuleModel->getModuleConfig('syndication');
68
69
		$site_url = trim(Context::get('site_url'));
0 ignored issues
show
Unused Code introduced by
$site_url is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
70
		if(!$module_config->site_url) return $this->makeObject(-1,'msg_site_url_is_null');
71
		if(!$module_config->syndication_token) return $this->makeObject(-1,'msg_syndication_token_is_null');
72
73
		$id = $oSyndicationModel->getID('site');
74
75
		// site_url 정보와 token 정보를 이용해서 ping 전송 테스트
76
		if($oSyndicationController->ping($id, 'site')===FALSE)
77
		{
78
			$this->setError(-1);
79
			$this->setMessage($oSyndicationController->ping_message);
0 ignored issues
show
Bug introduced by
The property ping_message does not seem to exist. Did you mean message?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
80
		}
81
		else
82
		{
83
			$this->setMessage('msg_success_ping_test');
84
		}
85
	}
86
}
87