Conditions | 13 |
Paths | 1536 |
Total Lines | 40 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
47 | public function parseQueryParameters(?array $sessionTicket, Request $request): array |
||
48 | { |
||
49 | $forceAuthn = isset($_GET['renew']) && $_GET['renew']; |
||
50 | $sessionRenewId = $sessionTicket ? $sessionTicket['renewId'] : null; |
||
51 | |||
52 | $query = []; |
||
53 | |||
54 | if ($sessionRenewId && $forceAuthn) { |
||
55 | $query['renewId'] = $sessionRenewId; |
||
56 | } |
||
57 | |||
58 | if (isset($_REQUEST['service'])) { |
||
59 | $query['service'] = $_REQUEST['service']; |
||
60 | } |
||
61 | |||
62 | if (isset($_REQUEST['TARGET'])) { |
||
63 | $query['TARGET'] = $_REQUEST['TARGET']; |
||
64 | } |
||
65 | |||
66 | if (isset($_REQUEST['method'])) { |
||
67 | $query['method'] = $_REQUEST['method']; |
||
68 | } |
||
69 | |||
70 | if (isset($_REQUEST['renew'])) { |
||
71 | $query['renew'] = $_REQUEST['renew']; |
||
72 | } |
||
73 | |||
74 | if (isset($_REQUEST['gateway'])) { |
||
75 | $query['gateway'] = $_REQUEST['gateway']; |
||
76 | } |
||
77 | |||
78 | if (\array_key_exists('language', $_GET)) { |
||
79 | $query['language'] = \is_string($_GET['language']) ? $_GET['language'] : null; |
||
80 | } |
||
81 | |||
82 | if (isset($_REQUEST['debugMode'])) { |
||
83 | $query['debugMode'] = $_REQUEST['debugMode']; |
||
84 | } |
||
85 | |||
86 | return $query; |
||
87 | } |
||
106 |
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