Completed
Push — master ( 87b7a4...6ce28d )
by Gaetano
11:11 queued 06:38
created

DebuggerTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 24.24 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 0
Metric Value
dl 8
loc 33
rs 10
c 0
b 0
f 0
wmc 4
lcom 2
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testController() 0 3 1
A testIndex() 0 3 1
A setUp() 0 7 1
A testAction() 0 3 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
include_once __DIR__ . '/LocalFileTestCase.php';
4
5
class DebuggerTest extends PhpXmlRpc_LocalFileTestCase
6
{
7
    public function setUp()
8
    {
9
        $this->args = argParser::getArgs();
10
11
        $this->baseUrl = $this->args['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/debugger/', $this->args['URI'] );
12
13
        $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] );
14
    }
15
16
    public function testIndex()
17
    {
18
        $page = $this->request('index.php');
0 ignored issues
show
Unused Code introduced by
The assignment to $page is dead and can be removed.
Loading history...
19
    }
20
21
    public function testController()
22
    {
23
        $page = $this->request('controller.php');
0 ignored issues
show
Unused Code introduced by
The assignment to $page is dead and can be removed.
Loading history...
24
    }
25
26
    /**
27
     * @todo test:
28
     * - list methods
29
     * - describe a method
30
     * - execute a method
31
     * - wrap a method
32
     */
33
    public function testAction()
34
    {
35
        $page = $this->request('action.php');
0 ignored issues
show
Unused Code introduced by
The assignment to $page is dead and can be removed.
Loading history...
36
    }
37
}
38