| Conditions | 12 |
| Paths | 13 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| 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 |
||
| 60 | public function watch_for_trigger() { |
||
| 61 | |||
| 62 | if ( isset( $_GET['page'] ) && 'lsx-wetu-importer' === $_GET['page'] && isset( $_GET['tab'] ) && 'settings' === $_GET['tab'] ) { |
||
| 63 | $options = lsx_wetu_get_options(); |
||
| 64 | |||
| 65 | // Check what state the option is in. |
||
| 66 | $accommodation_cron = 'deactivate'; |
||
| 67 | if ( isset( $options['accommodation_images_cron'] ) && '' !== $options['accommodation_images_cron'] ) { |
||
| 68 | $accommodation_cron = 'activate'; |
||
| 69 | } |
||
| 70 | |||
| 71 | // Check what state the cron is in. |
||
| 72 | $schedule = false; |
||
| 73 | if ( wp_next_scheduled( 'lsx_wetu_accommodation_images_cron' ) ) { |
||
| 74 | $schedule = true; |
||
| 75 | } |
||
| 76 | |||
| 77 | // If activate and its not running. |
||
| 78 | if ( false === $schedule && 'activate' === $accommodation_cron ) { |
||
| 79 | $schedule = 'daily'; |
||
| 80 | $this->schedule( 'lsx_wetu_accommodation_images_cron', $schedule ); |
||
| 81 | } elseif ( true === $schedule && 'deactivate' === $accommodation_cron ) { |
||
| 82 | $this->deactivate(); |
||
| 83 | } |
||
| 144 |
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