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

seoAdminController::procSeoAdminSaveSetting()   C

Complexity

Conditions 9
Paths 36

Size

Total Lines 70
Code Lines 44

Duplication

Lines 9
Ratio 12.86 %

Importance

Changes 0
Metric Value
cc 9
eloc 44
nc 36
nop 0
dl 9
loc 70
rs 6.1585
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
class seoAdminController extends seo
3
{
4
	function procSeoAdminSaveSetting()
5
	{
6
		$oModuleController = getController('module');
7
8
		$vars = Context::getRequestVars();
9
		$config = $this->getConfig();
10
11
		if ($vars->setting_section == 'general') {
12
			// 기본 설정
13
			$config->enable = ($vars->enable === 'Y') ? 'Y' : 'N';
0 ignored issues
show
Bug introduced by
The property enable does not seem to exist in BaseObject.

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...
14
			$config->use_optimize_title = $vars->use_optimize_title;
0 ignored issues
show
Bug introduced by
The property use_optimize_title does not seem to exist in BaseObject.

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...
15
			$config->site_name = $vars->site_name;
0 ignored issues
show
Bug introduced by
The property site_name does not seem to exist in BaseObject.

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...
16
			$config->site_slogan = $vars->site_slogan;
0 ignored issues
show
Bug introduced by
The property site_slogan does not seem to exist in BaseObject.

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...
17
			$config->site_description = $vars->site_description;
0 ignored issues
show
Bug introduced by
The property site_description does not seem to exist in BaseObject.

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...
18
			$config->site_keywords = $vars->site_keywords;
0 ignored issues
show
Bug introduced by
The property site_keywords does not seem to exist in BaseObject.

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...
19
20
			if ($vars->site_image) {
21
				$path = _XE_PATH_ . 'files/attach/site_image/';
22
				$ext = strtolower(array_pop(explode('.', $vars->site_image['name'])));
0 ignored issues
show
Bug introduced by
explode('.', $vars->site_image['name']) cannot be passed to array_pop() as the parameter $array expects a reference.
Loading history...
Bug introduced by
The property site_image does not seem to exist in BaseObject.

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...
23
				$timestamp = time();
24
				$filename = "site_image.{$timestamp}.{$ext}";
25
				FileHandler::copyFile($vars->site_image['tmp_name'], $path . $filename);
26
				$config->site_image = $filename;
27
28
				$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
29 View Code Duplication
				if($oCacheHandler->isSupport()) {
30
					list($width, $height) = @getimagesize($path . $filename);
31
					$site_image_dimension = array(
32
						'width' => $width,
33
						'height' => $height
34
					);
35
					$cache_key = 'seo:site_image';
36
					$oCacheHandler->put($cache_key, $site_image_dimension);
37
				}
38
			}
39
		} elseif ($vars->setting_section == 'analytics') {
0 ignored issues
show
Bug introduced by
The property setting_section does not seem to exist in BaseObject.

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...
40
			// analytics
41
42
			// Google
43
			$config->ga_id = trim($vars->ga_id);
0 ignored issues
show
Bug introduced by
The property ga_id does not seem to exist in BaseObject.

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...
44
			$config->ga_except_admin = $vars->ga_except_admin;
0 ignored issues
show
Bug introduced by
The property ga_except_admin does not seem to exist in BaseObject.

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...
45
46
			// Naver
47
			$config->na_id = trim($vars->na_id);
0 ignored issues
show
Bug introduced by
The property na_id does not seem to exist in BaseObject.

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...
48
			$config->na_except_admin = $vars->na_except_admin;
0 ignored issues
show
Bug introduced by
The property na_except_admin does not seem to exist in BaseObject.

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...
49
		} elseif ($vars->setting_section == 'miscellaneous') {
50
			// miscellaneous
51
52
			// Facebook
53
			$config->fb_app_id = trim($vars->fb_app_id);
0 ignored issues
show
Bug introduced by
The property fb_app_id does not seem to exist in BaseObject.

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...
54
			$config->fb_admins = trim($vars->fb_admins);
0 ignored issues
show
Bug introduced by
The property fb_admins does not seem to exist in BaseObject.

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...
55
		}
56
57
		$config->site_image_url = NULL;
58
59
		$oModuleController->updateModuleConfig('seo', $config);
60
61
		if($config->enable === 'Y') {
62
			$this->moduleUpdate();
63
		} else {
64
			// Delete Triggers
65
			$oModuleController = getController('module');
66
			$oModuleController->deleteModuleTriggers('seo');
67
		}
68
69
		$this->setMessage('success_updated');
70
		if (Context::get('success_return_url')) {
71
			$this->setRedirectUrl(Context::get('success_return_url'));
72
		}
73
	}
74
}
75
/* !End of file */
76