| Conditions | 3 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function __construct() |
||
| 29 | { |
||
| 30 | try { |
||
| 31 | $this->connection = new mysqli(DB_HOST, DB_USER, DB_PASSWD_CLEAR, DB_NAME); |
||
| 32 | |||
| 33 | if ( mysqli_connect_errno()) { |
||
| 34 | throw new Exception("Could not connect to database."); |
||
| 35 | } |
||
| 36 | } catch (Exception $e) { |
||
| 37 | throw new Exception($e->getMessage()); |
||
| 38 | } |
||
| 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.