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.

JFormFieldDevelop::getOptions()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 26

Duplication

Lines 26
Ratio 100 %

Importance

Changes 0
Metric Value
cc 3
nc 4
nop 0
dl 26
loc 26
rs 9.504
c 0
b 0
f 0
1
<?php
2
/**
3
 * @package     Com_Localise
4
 * @subpackage  models
5
 *
6
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
7
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
8
 */
9
10
defined('_JEXEC') or die;
11
12
JFormHelper::loadFieldClass('list');
13
14
/**
15
 * Form Field Place class.
16
 *
17
 * @package     Extensions.Components
18
 * @subpackage  Localise
19
 *
20
 * @since       1.0
21
 */
22 View Code Duplication
class JFormFieldDevelop extends JFormFieldList
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...
23
{
24
	/**
25
	 * The field type.
26
	 *
27
	 * @var    string
28
	 */
29
	protected $type = 'Develop';
30
31
	/**
32
	 * Method to get the field input.
33
	 *
34
	 * @return  string    The field input.
35
	 */
36
	protected function getOptions()
37
	{
38
		$attributes = '';
39
40
		if ($v = (string) $this->element['onchange'])
41
		{
42
			$attributes .= ' onchange="' . $v . '"';
43
		}
44
45
		$attributes .= ' class="' . (string) $this->element['class'] . ' iconlist-16-' . $this->value . '"';
46
		$options = array();
47
48
		foreach ($this->element->children() as $option)
49
		{
50
			$options[] = JHtml::_('select.option', $option->attributes('value'), JText::_(trim($option)), array('option.attr' => 'attributes', 'attr' => ''));
51
		}
52
53
		$options[] = JHtml::_('select.option', 'complete', JText::sprintf('COM_LOCALISE_OPTION_TRANSLATIONS_DEVELOP_COMPLETE'),
54
					array('option.attr' => 'attributes', 'attr' => 'class="iconlist-16-equal"')
55
					);
56
		$options[] = JHtml::_('select.option', 'incomplete', JText::sprintf('COM_LOCALISE_OPTION_TRANSLATIONS_DEVELOP_INCOMPLETE'),
57
					array('option.attr' => 'attributes', 'attr' => 'class="iconlist-16-changed"')
58
					);
59
60
		return $options;
61
	}
62
}
63