Conditions | 3 |
Paths | 3 |
Total Lines | 32 |
Code Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | public function validateIp($ipAdress) |
||
38 | { |
||
39 | $accessToken = $this->keys["ipValidator"]; |
||
40 | $stackUrl = 'http://api.ipstack.com/' . $ipAdress . '?access_key=' . $accessToken . ''; |
||
41 | |||
42 | $host = ""; |
||
43 | $stack = ""; |
||
44 | $type = ""; |
||
45 | $valid = ""; |
||
46 | |||
47 | if (filter_var($ipAdress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { |
||
48 | $host = gethostbyaddr($ipAdress); |
||
49 | $stack = json_decode($this->curl($stackUrl)); |
||
50 | $type = "IPv4"; |
||
51 | $valid = true; |
||
52 | } elseif (filter_var($ipAdress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { |
||
53 | $host = gethostbyaddr($ipAdress); |
||
54 | $stack = json_decode($this->curl($stackUrl)); |
||
55 | $type = "IPv6"; |
||
56 | $valid = true; |
||
57 | } else { |
||
58 | $valid = false; |
||
59 | } |
||
60 | |||
61 | $data = [ |
||
62 | "ip" => $ipAdress, |
||
63 | "valid" => $valid, |
||
64 | "type" => $type, |
||
65 | "host" => $host, |
||
66 | "stack" => $stack |
||
67 | ]; |
||
68 | return $data; |
||
69 | } |
||
87 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths