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

OpenStackV3   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
declare(strict_types=1);
3
/**
4
 * @copyright Copyright (c) 2018 Robin Appelman <[email protected]>
5
 *
6
 * @license GNU AGPL version 3 or any later version
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License as
10
 * published by the Free Software Foundation, either version 3 of the
11
 * License, or (at your option) any later version.
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
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 OpenStackV3 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::openstackv3')
37
			->setScheme(self::SCHEME_OPENSTACK)
38
			->setText($l->t('OpenStack v3'))
39
			->addParameters([
40
				new DefinitionParameter('user', $l->t('Username')),
41
				new DefinitionParameter('domain', $l->t('Domain')),
42
				(new DefinitionParameter('password', $l->t('Password')))
43
					->setType(DefinitionParameter::VALUE_PASSWORD),
44
				new DefinitionParameter('url', $l->t('Identity endpoint URL'))
45
			])
46
		;
47
	}
48
49
}
50