Conditions | 13 |
Paths | 43 |
Total Lines | 50 |
Code Lines | 28 |
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 |
||
36 | final public function description(Event $event, $param): void |
||
37 | { |
||
38 | if (empty($event->data) || empty($event->data['meta'])) { |
||
39 | return; |
||
40 | } |
||
41 | |||
42 | global $ID; |
||
43 | $source = $this->getConf('keyword_source'); |
||
44 | if (empty($source)) { |
||
45 | $source = 'abstract'; |
||
46 | } |
||
47 | |||
48 | if ($source === KEYWORD_SOURCE_ABSTRACT) { |
||
49 | if (auth_quickaclcheck($ID) < AUTH_READ) { |
||
1 ignored issue
–
show
|
|||
50 | // don't add meta header when user has no read permissions |
||
51 | return; |
||
52 | } |
||
53 | |||
54 | $d = p_get_metadata($ID, 'description'); |
||
1 ignored issue
–
show
|
|||
55 | if (empty($d)) { |
||
56 | return; |
||
57 | } |
||
58 | |||
59 | $a = str_replace("\n", " ", $d['abstract']); |
||
60 | if (empty($a)) { |
||
61 | return; |
||
62 | } |
||
63 | } |
||
64 | |||
65 | if ($source === KEYWORD_SOURCE_GLOBAL) { |
||
66 | $a = $this->getConf('global_description'); |
||
67 | if (empty($a)) { |
||
68 | return; |
||
69 | } |
||
70 | } |
||
71 | |||
72 | if ($source === KEYWORD_SOURCE_SYNTAX) { |
||
73 | if (auth_quickaclcheck($ID) < AUTH_READ) { |
||
74 | // don't add meta header when user has no read permissions |
||
75 | return; |
||
76 | } |
||
77 | $metadata = p_get_metadata($ID); |
||
78 | $a = $metadata['plugin_description']['keywords']; |
||
79 | if (empty($a)) { |
||
80 | return; |
||
81 | } |
||
82 | } |
||
83 | |||
84 | $m = ["name" => "description", "content" => $a]; |
||
85 | $event->data['meta'][] = $m; |
||
86 | } |
||
88 |
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