| Conditions | 22 |
| Paths | 128 |
| Total Lines | 66 |
| Code Lines | 42 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | 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 |
||
| 148 | private function renderUrl(Url $tag) |
||
| 149 | { |
||
| 150 | $this->append('<url>', 1); |
||
| 151 | if (! empty($tag->url)) { |
||
| 152 | $this->append('<loc>' . $this->format(url($tag->url)) . '</loc>', 2); |
||
| 153 | } |
||
| 154 | if (count($tag->alternates)) { |
||
| 155 | foreach ($tag->alternates as $alternate) { |
||
| 156 | $this->append('<xhtml:link rel="alternate" hreflang="' . $this->format($alternate->locale) . '" href="' . $this->format(url($alternate->url)) . '" />', 2); |
||
| 157 | } |
||
| 158 | } |
||
| 159 | if (! empty($tag->lastModificationDate)) { |
||
| 160 | $this->append('<lastmod>' . $tag->lastModificationDate->format(DateTime::ATOM) . '</lastmod>', 2); |
||
| 161 | } |
||
| 162 | if (! empty($tag->changeFrequency)) { |
||
| 163 | $this->append('<changefreq>' . $this->format($tag->changeFrequency) . '</changefreq>', 2); |
||
| 164 | } |
||
| 165 | if (! empty($tag->priority)) { |
||
| 166 | $this->append('<priority>' . number_format($tag->priority, 1) . '</priority>', 2); |
||
| 167 | } |
||
| 168 | if (count($tag->images)) { |
||
| 169 | foreach ($tag->images as $image) { |
||
| 170 | if (! empty($image->url)) { |
||
| 171 | $this->append('<image:image>', 2); |
||
| 172 | $this->append('<image:loc>' . url($image->url) . '</image:loc>', 3); |
||
| 173 | if (! empty($image->caption)) { |
||
| 174 | $this->append('<image:caption>' . $this->format($image->caption) . '</image:caption>', 3); |
||
| 175 | } |
||
| 176 | if (! empty($image->geo_location)) { |
||
| 177 | $this->append('<image:geo_location>' . $this->format($image->geo_location) . '</image:geo_location>', 3); |
||
| 178 | } |
||
| 179 | if (! empty($image->title)) { |
||
| 180 | $this->append('<image:title>' . $this->format($image->title) . '</image:title>', 3); |
||
| 181 | } |
||
| 182 | if (! empty($image->license)) { |
||
| 183 | $this->append('<image:license>' . $this->format($image->license) . '</image:license>', 3); |
||
| 184 | } |
||
| 185 | $this->append('</image:image>', 2); |
||
| 186 | } |
||
| 187 | } |
||
| 188 | } |
||
| 189 | if (count($tag->news)) { |
||
| 190 | foreach ($tag->news as $new) { |
||
| 191 | $this->append('<news:news>', 2); |
||
| 192 | if (! empty($new->publication_date)) { |
||
| 193 | $this->append('<news:publication_date>' . $new->publication_date->format('Y-m-d') . '</news:publication_date>', 3); |
||
| 194 | } |
||
| 195 | if (! empty($new->title)) { |
||
| 196 | $this->append('<news:title>' . $this->format($new->title) . '</news:title>', 3); |
||
| 197 | } |
||
| 198 | if (! empty($new->name) || ! empty($new->language)) { |
||
| 199 | $this->append('<news:publication>', 3); |
||
| 200 | if (! empty($new->name)) { |
||
| 201 | $this->append('<news:name>' . $this->format($new->name) . '</news:name>', 4); |
||
| 202 | } |
||
| 203 | |||
| 204 | if (! empty($new->language)) { |
||
| 205 | $this->append('<news:language>' . $this->format($new->language) . '</news:language>', 4); |
||
| 206 | } |
||
| 207 | $this->append('</news:publication>', 3); |
||
| 208 | } |
||
| 209 | $this->append('</news:news>', 2); |
||
| 210 | } |
||
| 211 | } |
||
| 212 | |||
| 213 | $this->append('</url>', 1); |
||
| 214 | } |
||
| 292 |
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