Passed
Push — master ( ccc7b7...4879bd )
by Anthony
02:38
created

MissionsAleatoire::getTestCheckMission()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 14
rs 9.2
cc 4
eloc 7
nc 3
nop 0
1
<?php
2
	namespace modules\bataille\app\controller;
3
	
4
	
5
	use core\App;
6
	
7
	class MissionsAleatoire {
8
		
9
		
10
		
11
		//-------------------------- BUILDER ----------------------------------------------------------------------------//
12
		public function __construct() {
13
			$dbc = App::getDb();
0 ignored issues
show
Unused Code introduced by
$dbc 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...
14
			$dbc1 = Bataille::getDb();
0 ignored issues
show
Unused Code introduced by
$dbc1 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...
15
			
16
			//test si on a deje des missions dans la base
17
			
18
		}
19
		//-------------------------- END BUILDER ----------------------------------------------------------------------------//
20
		
21
		
22
		
23
		//-------------------------- GETTER ----------------------------------------------------------------------------//
24
		private function getTestCheckMission() {
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
25
			$dbc = App::getDb();
26
			
27
			$query = $dbc->select("last_check_mission")->from("_bataille_base")->where("ID_base", "=", Bataille::getIdBase())->get();
28
			
29
			if (is_array($query) && (count($query) == 1)) {
30
				foreach ($query as $obj) {
31
					$last_check_mission = $obj->last_check_mission;
0 ignored issues
show
Unused Code introduced by
$last_check_mission 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...
32
				}
33
				
34
				$today = new \DateTime();
0 ignored issues
show
Unused Code introduced by
$today 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...
35
				
36
			}
37
		}
38
		//-------------------------- END GETTER ----------------------------------------------------------------------------//
39
		
40
		
41
		
42
		//-------------------------- SETTER ----------------------------------------------------------------------------//
43
		//-------------------------- END SETTER ----------------------------------------------------------------------------//
44
		
45
	}