Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 100 % |
Changes | 0 |
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
13 | View Code Duplication | abstract class AbstractByOrderItemConditionPlugin implements ConditionInterface |
|
14 | { |
||
15 | |||
16 | /** |
||
17 | * @return string |
||
18 | */ |
||
19 | abstract protected function getConditionalStatus(); |
||
20 | |||
21 | /** |
||
22 | * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $orderItem |
||
23 | * |
||
24 | * @return bool |
||
25 | */ |
||
26 | public function check(SpySalesOrderItem $orderItem) |
||
27 | { |
||
28 | $payment = $this->getPaymentAmazonpayBySalesOrderItem($orderItem); |
||
29 | |||
30 | if ($payment === null) { |
||
31 | return true; |
||
32 | } |
||
33 | |||
34 | return $payment->getStatus() === $this->getConditionalStatus(); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem $orderItem |
||
39 | * |
||
40 | * @return \Orm\Zed\Amazonpay\Persistence\SpyPaymentAmazonpay|null |
||
1 ignored issue
–
show
|
|||
41 | */ |
||
42 | protected function getPaymentAmazonpayBySalesOrderItem(SpySalesOrderItem $orderItem) |
||
51 | } |
||
52 | |||
54 |
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