InlineIfTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testInlineIfRule() 0 9 1
1
<?php
2
3
namespace MS\PHPMD\Tests\Functional\CleanCode;
4
5
use MS\PHPMD\Tests\Functional\AbstractProcessTest;
6
7
/**
8
 * Class InlineIfTest
9
 *
10
 * @package MS\PHPMD\Tests\Functional\CleanCode
11
 */
12
class InlineIfTest extends AbstractProcessTest
13
{
14
    /**
15
     * @covers MS\PHPMD\Rule\CleanCode\InlineIf
16
     */
17
    public function testInlineIfRule()
18
    {
19
        $output = $this
20
            ->runPhpmd('Service/GeneralManager.php', 'cleancode.xml')
21
            ->getOutput();
22
23
        $this->assertContains('GeneralManager.php:17	Try to avoid using inline ifs. They conceal the complexity of your code. Furthermore they obstruct the expandability. Refactor your code and increase the readability.', $output);
24
        $this->assertContains('GeneralManager.php:27	Try to avoid using inline ifs. They conceal the complexity of your code. Furthermore they obstruct the expandability. Refactor your code and increase the readability.', $output);
25
    }
26
}
27