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

MissionsAleatoire   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getTestCheckMission() 0 14 4
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
	}