| Conditions | 4 |
| Paths | 7 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 55 | private function executeStatement($query = "" , $params = []) |
||
| 56 | { |
||
| 57 | try { |
||
| 58 | $stmt = $this->connection->prepare( $query ); |
||
| 59 | |||
| 60 | if($stmt === false) { |
||
| 61 | throw New Exception("Unable to do prepared statement: " . $query); |
||
| 62 | } |
||
| 63 | |||
| 64 | if( $params ) { |
||
| 65 | $stmt->bind_param($params[0], $params[1]); |
||
| 66 | } |
||
| 67 | |||
| 68 | $stmt->execute(); |
||
| 69 | |||
| 70 | return $stmt; |
||
| 71 | } catch(Exception $e) { |
||
| 72 | throw New Exception( $e->getMessage() ); |
||
| 73 | } |
||
| 75 | } |
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return,dieorexitstatements that have been added for debug purposes.In the above example, the last
return falsewill never be executed, because a return statement has already been met in every possible execution path.