Completed
Push — master ( 3957d4...ef55dd )
by Mehmet
10s
created

doc.delete.php ➔ app_content()   B

Complexity

Conditions 5
Paths 12

Size

Total Lines 18
Code Lines 31

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 5
eloc 31
nc 12
nop 2
dl 0
loc 18
rs 8.8571
1
<?php
2
3
function app_content($request, $args){
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $args is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
4
5
    global $ES;
6
7
    $index  = $args['index'];
8
    $type   = $args['type'];
9
    $id     = $args['id'];
10
11
    $params = [];
12
    $params['index']= $index;
13
    $params['type'] = $type;
14
    $params['id']   = $id;
15
    $results = $ES->delete($params);
0 ignored issues
show
Unused Code introduced by
$results is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
16
    
17
    sleep(1);
18
    header("location:" . BASE_HREF . "/" . $index . "/" . $type . "?res=success&req=delete");
19
    exit;
20
}