Conditions | 17 |
Paths | 32 |
Total Lines | 36 |
Code Lines | 32 |
Lines | 0 |
Ratio | 0 % |
Changes | 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 |
||
111 | public function oSVersion() |
||
112 | { |
||
113 | $UserAgent = self::agent(); |
||
114 | if (preg_match_all('/windows nt 10/i', $UserAgent)) { |
||
115 | $OsVersion = 'Windows 10'; |
||
116 | } elseif (preg_match_all('/windows nt 6.3/i', $UserAgent)) { |
||
117 | $OsVersion = 'Windows 8.1'; |
||
118 | } elseif (preg_match_all('/windows nt 6.2/i', $UserAgent)) { |
||
119 | $OsVersion = 'Windows 8'; |
||
120 | } elseif (preg_match_all('/windows nt 6.1/i', $UserAgent)) { |
||
121 | $OsVersion = 'Windows 7'; |
||
122 | } elseif (preg_match_all('/windows nt 6.0/i', $UserAgent)) { |
||
123 | $OsVersion = 'Windows Vista'; |
||
124 | } elseif (preg_match_all('/windows nt 5.1/i', $UserAgent)) { |
||
125 | $OsVersion = 'Windows Xp'; |
||
126 | } elseif (preg_match_all('/windows xp/i', $UserAgent)) { |
||
127 | $OsVersion = 'Windows Xp'; |
||
128 | } elseif (preg_match_all('/windows me/i', $UserAgent)) { |
||
129 | $OsVersion = 'Windows Me'; |
||
130 | } elseif (preg_match_all('/win98/i', $UserAgent)) { |
||
131 | $OsVersion = 'Windows 98'; |
||
132 | } elseif (preg_match_all('/win95/i', $UserAgent)) { |
||
133 | $OsVersion = 'Windows 95'; |
||
134 | } elseif (preg_match_all('/Windows Phone +[0-9]/i', $UserAgent, $match)) { |
||
135 | $OsVersion = $match; |
||
136 | } elseif (preg_match_all('/Android +[0-9]/i', $UserAgent, $match)) { |
||
137 | $OsVersion = $match; |
||
138 | } elseif (preg_match_all('/Linux +x[0-9]+/i', $UserAgent, $match)) { |
||
139 | $OsVersion = $match; |
||
140 | } elseif (preg_match_all('/mac os x [0-9]+/i', $UserAgent, $match)) { |
||
141 | $OsVersion = $match; |
||
142 | } elseif (preg_match_all('/os [0-9]+/i', $UserAgent, $match)) { |
||
143 | $OsVersion = $match; |
||
144 | } |
||
145 | |||
146 | return isset($OsVersion) ? $OsVersion : false; |
||
147 | } |
||
201 |
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