Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function metrics() |
||
19 | { |
||
20 | $request = $this->app->request(); |
||
|
|||
21 | $response = $this->app->response(); |
||
22 | |||
23 | $stats = $this->searcher->stats(); |
||
24 | |||
25 | $body = "# HELP xhgui_profiles_total Number of profiles collected.\n"; |
||
26 | $body .= "# TYPE xhgui_profiles_total gauge\n"; |
||
27 | $body .= sprintf("xhgui_profiles_total %0.1F\n\n", $stats['profiles']); |
||
28 | |||
29 | $body .= "# HELP xhgui_profile_bytes_total Size of profiles collected.\n"; |
||
30 | $body .= "# TYPE xhgui_profile_bytes_total gauge\n"; |
||
31 | $body .= sprintf("xhgui_profile_bytes_total %0.1F\n\n", $stats['bytes']); |
||
32 | |||
33 | $body .= "# HELP xhgui_latest_profile_seconds UNIX timestamp of most recent profile.\n"; |
||
34 | $body .= "# TYPE xhgui_latest_profile_seconds gauge\n"; |
||
35 | $body .= sprintf("xhgui_latest_profile_seconds %0.1F\n", $stats['latest']); |
||
36 | |||
37 | $response->body($body); |
||
38 | $response['Content-Type'] = 'text/plain; version=0.0.4'; |
||
39 | } |
||
40 | } |
||
41 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
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.