Completed
Push — master ( 707e60...bec0f5 )
by Jean-Christophe
01:22
created

Table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A generateSQL() 0 9 1
1
<?php
2
3
namespace micro\orm\reverse;
4
5
use micro\orm\OrmUtils;
6
7
class Table {
8
	private $model;
9
10
	public function __construct($model){
11
		$this->model=$model;
12
	}
13
14
	public function generateSQL(){
15
		$metas=OrmUtils::getModelMetadata($this->model);
0 ignored issues
show
Unused Code introduced by
$metas 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
		$table=OrmUtils::getTableName($this->model);
0 ignored issues
show
Unused Code introduced by
$table 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...
17
		$fieldnames=OrmUtils::getAnnotationInfo($this->model, "#fieldNames");
0 ignored issues
show
Unused Code introduced by
$fieldnames 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...
18
		$primaryKeys=OrmUtils::getKeyFields($this->model);
0 ignored issues
show
Unused Code introduced by
$primaryKeys 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...
19
		$serializables=OrmUtils::getSerializableFields($this->model);
20
		\var_dump($serializables);
0 ignored issues
show
Security Debugging Code introduced by
\var_dump($serializables); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
21
		\var_dump(OrmUtils::getFieldNames($this->model));
22
	}
23
}