ScenarioTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 2
dl 28
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 4 4 1
A testCode() 7 7 1
A testName() 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
namespace Wonnova\SDK\Test\Model;
3
4
use PHPUnit_Framework_TestCase as TestCase;
5
use Wonnova\SDK\Model\Scenario;
6
7
/**
8
 * Class ScenarioTest
9
 * @author Wonnova
10
 * @link http://www.wonnova.com
11
 */
12 View Code Duplication
class ScenarioTest extends TestCase
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...
13
{
14
    /**
15
     * @var Scenario
16
     */
17
    private $scenario;
18
19
    public function setUp()
20
    {
21
        $this->scenario = new Scenario();
22
    }
23
24
    public function testCode()
25
    {
26
        $expected = 'SCENARIO';
27
        $this->assertNull($this->scenario->getCode());
28
        $this->assertSame($this->scenario, $this->scenario->setCode($expected));
29
        $this->assertEquals($expected, $this->scenario->getCode());
30
    }
31
32
    public function testName()
33
    {
34
        $expected = 'Scenario';
35
        $this->assertNull($this->scenario->getName());
36
        $this->assertSame($this->scenario, $this->scenario->setName($expected));
37
        $this->assertEquals($expected, $this->scenario->getName());
38
    }
39
}
40