Completed
Push — master ( 4076c0...886762 )
by Morris
122:17 queued 106:43
created

OpenStackV2   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 18
loc 18
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 14 14 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
/**
3
 * @copyright Copyright (c) 2016, ownCloud, Inc.
4
 *
5
 * @author Robin McCorkell <[email protected]>
6
 *
7
 * @license AGPL-3.0
8
 *
9
 * This code is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU Affero General Public License, version 3,
11
 * as published by the Free Software Foundation.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU Affero General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public License, version 3,
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
20
 *
21
 */
22
23
namespace OCA\Files_External\Lib\Auth\OpenStack;
24
25
use \OCP\IL10N;
26
use \OCA\Files_External\Lib\DefinitionParameter;
27
use \OCA\Files_External\Lib\Auth\AuthMechanism;
28
29
/**
30
 * OpenStack Keystone authentication
31
 */
32 View Code Duplication
class OpenStackV2 extends AuthMechanism {
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...
33
34
	public function __construct(IL10N $l) {
35
		$this
36
			->setIdentifier('openstack::openstack')
37
			->setScheme(self::SCHEME_OPENSTACK)
38
			->setText($l->t('OpenStack v2'))
39
			->addParameters([
40
				new DefinitionParameter('user', $l->t('Username')),
41
				(new DefinitionParameter('password', $l->t('Password')))
42
					->setType(DefinitionParameter::VALUE_PASSWORD),
43
				new DefinitionParameter('tenant', $l->t('Tenant name')),
44
				new DefinitionParameter('url', $l->t('Identity endpoint URL')),
45
			])
46
		;
47
	}
48
49
}
50