| Conditions | 13 |
| Paths | 480 |
| Total Lines | 83 |
| Code Lines | 48 |
| 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 |
||
| 95 | protected function displayGameDetails(array $details): void |
||
| 96 | { |
||
| 97 | $this->info('=== Game Details ==='); |
||
| 98 | $this->newLine(); |
||
| 99 | |||
| 100 | // Basic info table |
||
| 101 | $basicInfo = [ |
||
| 102 | ['Title', $details['title'] ?? 'N/A'], |
||
| 103 | ['Steam ID', $details['steamid'] ?? 'N/A'], |
||
| 104 | ['Type', ucfirst($details['type'] ?? 'game')], |
||
| 105 | ['Publisher', $details['publisher'] ?? 'N/A'], |
||
| 106 | ['Developers', implode(', ', $details['developers'] ?? []) ?: 'N/A'], |
||
| 107 | ['Release Date', $details['releasedate'] ?? 'N/A'], |
||
| 108 | ['Genres', $details['genres'] ?? 'N/A'], |
||
| 109 | ['Platforms', implode(', ', $details['platforms'] ?? [])], |
||
| 110 | ]; |
||
| 111 | |||
| 112 | $this->table(['Property', 'Value'], $basicInfo); |
||
| 113 | |||
| 114 | // Scores |
||
| 115 | if (!empty($details['metacritic_score'])) { |
||
| 116 | $this->newLine(); |
||
| 117 | $this->info("Metacritic Score: {$details['metacritic_score']}"); |
||
| 118 | } |
||
| 119 | |||
| 120 | // Price |
||
| 121 | if (!empty($details['price'])) { |
||
| 122 | $price = $details['price']; |
||
| 123 | $this->newLine(); |
||
| 124 | $this->info('Pricing:'); |
||
| 125 | |||
| 126 | $priceInfo = [ |
||
| 127 | ['Currency', $price['currency'] ?? 'USD'], |
||
| 128 | ['Price', $price['final_formatted'] ?? sprintf('$%.2f', $price['final'] ?? 0)], |
||
| 129 | ]; |
||
| 130 | |||
| 131 | if (($price['discount_percent'] ?? 0) > 0) { |
||
| 132 | $priceInfo[] = ['Original', sprintf('$%.2f', $price['initial'] ?? 0)]; |
||
| 133 | $priceInfo[] = ['Discount', "{$price['discount_percent']}%"]; |
||
| 134 | } |
||
| 135 | |||
| 136 | $this->table(['Field', 'Value'], $priceInfo); |
||
| 137 | } |
||
| 138 | |||
| 139 | // Description |
||
| 140 | if (!empty($details['description'])) { |
||
| 141 | $this->newLine(); |
||
| 142 | $this->info('Description:'); |
||
| 143 | $this->line(wordwrap($details['description'], 80)); |
||
| 144 | } |
||
| 145 | |||
| 146 | // URLs |
||
| 147 | $this->newLine(); |
||
| 148 | $this->info('Links:'); |
||
| 149 | $this->line("Store: {$details['directurl']}"); |
||
| 150 | |||
| 151 | if (!empty($details['website'])) { |
||
| 152 | $this->line("Website: {$details['website']}"); |
||
| 153 | } |
||
| 154 | |||
| 155 | if (!empty($details['metacritic_url'])) { |
||
| 156 | $this->line("Metacritic: {$details['metacritic_url']}"); |
||
| 157 | } |
||
| 158 | |||
| 159 | // Stats |
||
| 160 | if (!empty($details['achievements']) || !empty($details['recommendations'])) { |
||
| 161 | $this->newLine(); |
||
| 162 | $this->info('Stats:'); |
||
| 163 | |||
| 164 | if (!empty($details['achievements'])) { |
||
| 165 | $this->line("Achievements: {$details['achievements']}"); |
||
| 166 | } |
||
| 167 | |||
| 168 | if (!empty($details['recommendations'])) { |
||
| 169 | $this->line("Recommendations: " . number_format($details['recommendations'])); |
||
| 170 | } |
||
| 171 | } |
||
| 172 | |||
| 173 | // Categories (multiplayer, etc.) |
||
| 174 | if (!empty($details['categories'])) { |
||
| 175 | $this->newLine(); |
||
| 176 | $this->info('Features:'); |
||
| 177 | $this->line(implode(', ', $details['categories'])); |
||
| 178 | } |
||
| 182 |
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