| Conditions | 10 |
| Paths | 17 |
| Total Lines | 35 |
| Code Lines | 22 |
| 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 |
||
| 41 | public function transform($issue) |
||
| 42 | { |
||
| 43 | if (null === $issue) { |
||
| 44 | return null; |
||
| 45 | } |
||
| 46 | |||
| 47 | $issueEntity = new Issue(); |
||
| 48 | $issueEntity->setId($issue['id']); |
||
| 49 | $issueEntity->setTitle($issue['title']); |
||
| 50 | $issueEntity->setStatus($this->formatState($issue['state'])); |
||
| 51 | $issueEntity->setDescription($issue['description']); |
||
| 52 | $issueEntity->setCreatedAt($this->formatDate($issue['created_at'])); |
||
| 53 | if (isset($issue['closed_at'])) { |
||
| 54 | $issueEntity->setClosedAt($this->formatDate($issue['closed_at'])); |
||
| 55 | } |
||
| 56 | $issueEntity->setUpdatedAt($this->formatDate($issue['updated_at'])); |
||
| 57 | |||
| 58 | //Map Issue labels |
||
| 59 | if (isset($issue['labels']) && is_array($issue['labels'])) { |
||
| 60 | foreach ($issue['labels'] as $label) { |
||
| 61 | $issueLabelEntity = $this->issueLabelTransformer->transform($label); |
||
| 62 | $issueEntity->addIssueLabel($issueLabelEntity); |
||
| 63 | } |
||
| 64 | } |
||
| 65 | |||
| 66 | if (isset($issue['author']) && is_array($issue['author'])) { |
||
| 67 | $user = $this->userTransformer->transform($issue['author']); |
||
| 68 | $issueEntity->setUser($user); |
||
| 69 | } |
||
| 70 | if (isset($issue['milestone']) && is_array($issue['milestone'])) { |
||
| 71 | $issueMilestoneEntity = $this->issueMilestoneTransformer->transform($issue['milestone']); |
||
| 72 | $issueEntity->setIssueMilestone($issueMilestoneEntity); |
||
| 73 | } |
||
| 74 | |||
| 75 | return $issueEntity; |
||
| 76 | } |
||
| 131 |
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