AbstractConfigurationFile   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 70 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 7
loc 10
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configureSchema() 7 7 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
namespace Magium\Configuration\File\Configuration;
4
5
use Magium\Configuration\File\AbstractAdapter;
6
7
abstract class AbstractConfigurationFile extends AbstractAdapter
8
{
9 8 View Code Duplication
    protected function configureSchema(\DOMElement $element)
10
    {
11 8
        $schema = realpath(__DIR__ . '/../../../assets/configuration.xsd');
12 8
        $element->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', 'http://www.magiumlib.com/Configuration');
13 8
        $element->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', 'http://www.magiumlib.com/Configuration ' . $schema);
14 8
        return $schema;
15
    }
16
}
17