| Conditions | 25 |
| Paths | 96 |
| Total Lines | 30 |
| Code Lines | 26 |
| 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 |
||
| 29 | public function __construct($data) { |
||
| 30 | $this->id = $data->id; |
||
| 31 | $this->imdbId = @$data->imdbId ?: null; |
||
| 32 | $this->zap2itId = @$data->zap2itId ?: null; |
||
| 33 | $this->title = @$data->seriesName ?: null; |
||
| 34 | $this->slug = @$data->slug ?: null; |
||
| 35 | $this->alternativeTitles = @$data->aliases ?: null; |
||
| 36 | $this->banner = @$data->banner ?: null; |
||
| 37 | $this->bannerURL = (isset($data->banner)) ? TVDB::IMAGE_URL_PREFIX . $data->banner : null; |
||
| 38 | $this->status = @$data->status ?: null; |
||
| 39 | $this->firstAired = (isset($data->firstAired)) ? Carbon::parse($data->firstAired) : null; |
||
| 40 | $this->network = [ |
||
| 41 | 'id' => @$data->networkId ?: null, |
||
| 42 | 'name' => @$data->network ?: null |
||
| 43 | ]; |
||
| 44 | $this->runtime = (isset($data->runtime) && strlen($data->runtime) && is_numeric($data->runtime)) ? (int) $data->runtime : null; |
||
| 45 | $this->genres = @$data->genre ?: null; |
||
| 46 | $this->synopsis = @$data->overview ?: null; |
||
| 47 | $this->lastUpdated = (isset($data->lastUpdated)) ? Carbon::createFromTimestamp($data->lastUpdated) : null; |
||
| 48 | $this->airs = [ |
||
| 49 | 'dayOfWeek' => @$data->airsDayOfWeek ?: null, |
||
| 50 | 'time' => @$data->airsTime ?: null |
||
| 51 | ]; |
||
| 52 | $this->watchRating = (strlen($data->rating)) ? $data->rating : null; |
||
| 53 | $this->tvdbRating = [ |
||
| 54 | 'average' => @$data->siteRating ?: null, |
||
| 55 | 'count' => @$data->siteRatingCount ?: null |
||
| 56 | ]; |
||
| 57 | $this->added = @$data->added ?: null; |
||
| 58 | $this->addedBy = @$data->addedBy ?: null; |
||
| 59 | } |
||
| 95 | } |
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