| Conditions | 11 |
| Paths | 48 |
| Total Lines | 77 |
| Code Lines | 41 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | 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 |
||
| 82 | |||
| 83 | $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'salesman', 1); |
||
| 84 | if ($isSalesman) |
||
| 85 | $peopleRole[] = 'salesman'; |
||
| 86 | |||
| 87 | |||
| 88 | return array_values(array_unique(empty($peopleRole) ? ['guest'] : $peopleRole)); |
||
| 89 | } |
||
| 90 | |||
| 91 | /** |
||
| 92 | * Retorna a people da empresa principal segundo o dominio da api |
||
| 93 | * |
||
| 94 | * @return People |
||
| 95 | */ |
||
| 96 | public function getMainCompany(): People |
||
| 97 | { |
||
| 98 | $domain = $_SERVER['HTTP_HOST']; |
||
| 99 | $company = $this->manager->getRepository(PeopleDomain::class)->findOneBy(['domain' => $domain]); |
||
| 100 | |||
| 101 | if ($company === null) |
||
| 102 | throw new \Exception( |
||
| 103 | sprintf('Main company "%s" not found', $domain) |
||
| 104 | ); |
||
| 105 | |||
| 106 | return $company->getPeople(); |
||
| 107 | } |
||
| 108 | } |
||
| 109 |
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