Conditions | 22 |
Paths | 128 |
Total Lines | 68 |
Code Lines | 43 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
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 |
||
122 | private function urlTemplate(Url $tag) : string |
||
123 | { |
||
124 | $template = '<url>'; |
||
125 | if (! empty($tag->url)) { |
||
126 | $template .= '<loc>' . url($tag->url) . '</loc>'; |
||
127 | } |
||
128 | if (count($tag->alternates)) { |
||
129 | foreach ($tag->alternates as $alternate) { |
||
130 | $template .= '<xhtml:link rel="alternate" hreflang="' . $alternate->locale . '" href="' . url($alternate->url) . '" />'; |
||
131 | } |
||
132 | } |
||
133 | if (! empty($tag->lastModificationDate)) { |
||
134 | $template .= '<lastmod>' . $tag->lastModificationDate->format(DateTime::ATOM) . '</lastmod>'; |
||
135 | } |
||
136 | if (! empty($tag->changeFrequency)) { |
||
137 | $template .= '<changefreq>' . $tag->changeFrequency . '</changefreq>'; |
||
138 | } |
||
139 | if (! empty($tag->priority)) { |
||
140 | $template .= '<priority>' . number_format($tag->priority, 1) . '</priority>'; |
||
141 | } |
||
142 | if (count($tag->images)) { |
||
143 | foreach ($tag->images as $image) { |
||
144 | if (! empty($image->url)) { |
||
145 | $template .= '<image:image>'; |
||
146 | $template .= '<image:loc>' . url($image->url) . '</image:loc>'; |
||
147 | if (! empty($image->caption)) { |
||
148 | $template .= '<image:caption>' . $image->caption . '</image:caption>'; |
||
149 | } |
||
150 | if (! empty($image->geo_location)) { |
||
151 | $template .= '<image:geo_location>' . $image->geo_location . '</image:geo_location>'; |
||
152 | } |
||
153 | if (! empty($image->title)) { |
||
154 | $template .= '<image:title>' . $image->title . '</image:title>'; |
||
155 | } |
||
156 | if (! empty($image->license)) { |
||
157 | $template .= '<image:license>' . $image->license . '</image:license>'; |
||
158 | } |
||
159 | $template .= '</image:image>'; |
||
160 | } |
||
161 | } |
||
162 | } |
||
163 | if (count($tag->news)) { |
||
164 | foreach ($tag->news as $new) { |
||
165 | $template .= '<news:news>'; |
||
166 | if (! empty($new->publication_date)) { |
||
167 | $template .= '<news:publication_date>' . $new->publication_date->format('Y-m-d') . '</news:publication_date>'; |
||
168 | } |
||
169 | if (! empty($new->title)) { |
||
170 | $template .= '<news:title>' . $new->title . '</news:title>'; |
||
171 | } |
||
172 | if (! empty($new->name) || ! empty($new->language)) { |
||
173 | $template .= '<news:publication>'; |
||
174 | if (! empty($new->name)) { |
||
175 | $template .= '<news:name>' . $new->name . '</news:name>'; |
||
176 | } |
||
177 | |||
178 | if (! empty($new->language)) { |
||
179 | $template .= '<news:language>' . $new->language . '</news:language>'; |
||
180 | } |
||
181 | $template .= '</news:publication>'; |
||
182 | } |
||
183 | $template .= '</news:news>'; |
||
184 | } |
||
185 | } |
||
186 | |||
187 | $template .= '</url>'; |
||
188 | |||
189 | return $template; |
||
190 | } |
||
192 |
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