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
Pull Request — develop (#2084)
by
unknown
09:45
created

boardMobile::getBoardCommentPage()   C

Complexity

Conditions 7
Paths 4

Size

Total Lines 24
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 7
eloc 14
nc 4
nop 0
dl 0
loc 24
rs 6.7272
c 0
b 0
f 0
1
<?php
2
/* Copyright (C) NAVER <http://www.navercorp.com> */
3
4
require_once(_XE_PATH_.'modules/board/board.view.php');
5
6
class boardMobile extends boardView
7
{
8
	function init()
9
	{
10
		$oSecurity = new Security();
11
		$oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl');
12
13
		if($this->module_info->list_count) $this->list_count = $this->module_info->list_count;
14
		if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count;
15
		if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count;
0 ignored issues
show
Bug introduced by
The property search_list_count does not seem to exist. Did you mean list_count?

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
		if($this->module_info->mobile_search_list_count) $this->search_list_count = $this->module_info->mobile_search_list_count;
0 ignored issues
show
Bug introduced by
The property search_list_count does not seem to exist. Did you mean list_count?

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
		if($this->module_info->page_count) $this->page_count = $this->module_info->page_count;
18
		if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count;
19
		$this->except_notice = $this->module_info->except_notice == 'N' ? false : true;
0 ignored issues
show
Bug introduced by
The property except_notice does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
20
21
		// $this->_getStatusNameListecret option backward compatibility
22
		$oDocumentModel = getModel('document');
23
24
		$statusList = $this->_getStatusNameList($oDocumentModel);
25
		if(isset($statusList['SECRET']))
26
		{
27
			$this->module_info->secret = 'Y';
28
		}
29
30
		// use_category <=1.5.x, hide_category >=1.7.x
31
		$count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl));
32 View Code Duplication
		if($count_category)
33
		{
34
			if($this->module_info->hide_category)
35
			{
36
				$this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y';
37
			}
38
			else if($this->module_info->use_category)
39
			{
40
				$this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y';
41
			}
42
			else
43
			{
44
				$this->module_info->hide_category = 'N';
45
				$this->module_info->use_category = 'Y';
46
			}
47
		}
48
		else
49
		{
50
			$this->module_info->hide_category = 'Y';
51
			$this->module_info->use_category = 'N';
52
		}
53
54
		/**
55
		 * check the consultation function, if the user is admin then swich off consultation function
56
		 * if the user is not logged, then disppear write document/write comment./ view document
57
		 **/
58
		if($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read)
59
		{
60
			$this->consultation = true;
0 ignored issues
show
Bug introduced by
The property consultation does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
61
			if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
0 ignored issues
show
Bug introduced by
The property grant does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
62
		} else {
63
			$this->consultation = false;
64
		}
65
66
		$oDocumentModel = getModel('document');
67
		$extra_keys = $oDocumentModel->getExtraKeys($this->module_info->module_srl);
68
		Context::set('extra_keys', $extra_keys);
69
70
		$template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
71 View Code Duplication
		if(!is_dir($template_path)||!$this->module_info->mskin)
72
		{
73
			$this->module_info->mskin = 'default';
74
			$template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
75
		}
76
		$this->setTemplatePath($template_path);
77
		Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml');
78
	}
79
80
	function dispBoardCategory()
81
	{
82
		$this->dispBoardCategoryList();
83
		$category_list = Context::get('category_list');
0 ignored issues
show
Unused Code introduced by
$category_list 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...
84
		$this->setTemplateFile('category.html');
85
	}
86
87
	function getBoardCommentPage()
88
	{
89
		$document_srl = Context::get('document_srl');
90
		$oDocumentModel =& getModel('document');
91
		if(!$document_srl)
92
		{
93
			return new Object(-1, "msg_invalid_request");
94
		}
95
		
96
		if($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read))
97
		{
98
			return new Object(-1, "msg_not_permitted");
99
		}
100
		
101
		$oDocument = $oDocumentModel->getDocument($document_srl);
102
		if(!$oDocument->isExists())
103
		{
104
			return new Object(-1, "msg_invalid_request");
105
		}
106
		Context::set('oDocument', $oDocument);
107
		$oTemplate = TemplateHandler::getInstance();
108
		$html = $oTemplate->compile($this->getTemplatePath(), "comment.html");
109
		$this->add("html", $html);
110
	}
111
112
	function dispBoardMessage($msg_code)
113
	{
114
		$msg = Context::getLang($msg_code);
115
		$oMessageObject = &ModuleHandler::getModuleInstance('message','mobile');
116
		$oMessageObject->setError(-1);
117
		$oMessageObject->setMessage($msg);
118
		$oMessageObject->dispMessage();
119
120
		$this->setTemplatePath($oMessageObject->getTemplatePath());
121
		$this->setTemplateFile($oMessageObject->getTemplateFile());
122
	}
123
}
124