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