| Conditions | 7 |
| Paths | 7 |
| Total Lines | 67 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 |
||
| 43 | public function handleAjax(Doku_Event $event, $param) |
||
|
1 ignored issue
–
show
|
|||
| 44 | { |
||
| 45 | if ($event->data !== 'plugin_prosemirror') { |
||
| 46 | return; |
||
| 47 | } |
||
| 48 | $event->preventDefault(); |
||
| 49 | $event->stopPropagation(); |
||
| 50 | |||
| 51 | global $INPUT, $ID; |
||
| 52 | $ID = $INPUT->str('id'); |
||
| 53 | $responseData = []; |
||
| 54 | foreach ($INPUT->arr('actions') as $action) { |
||
| 55 | switch ($action) { |
||
| 56 | case 'resolveInternalLink': |
||
| 57 | { |
||
| 58 | $inner = $INPUT->str('inner'); |
||
| 59 | $responseData[$action] = $this->resolveInternalLink($inner, $ID); |
||
| 60 | break; |
||
| 61 | } |
||
| 62 | case 'resolveInterWikiLink': |
||
| 63 | { |
||
| 64 | $inner = $INPUT->str('inner'); |
||
| 65 | list($shortcut, $reference) = explode('>', $inner); |
||
| 66 | $responseData[$action] = $this->resolveInterWikiLink($shortcut, $reference); |
||
| 67 | break; |
||
| 68 | } |
||
| 69 | case 'resolveMedia': |
||
| 70 | { |
||
| 71 | $attrs = $INPUT->arr('attrs'); |
||
| 72 | $responseData[$action] = [ |
||
| 73 | 'data-resolvedHtml' => \dokuwiki\plugin\prosemirror\parser\ImageNode::resolveMedia( |
||
| 74 | $attrs['id'], |
||
| 75 | $attrs['title'], |
||
| 76 | $attrs['align'], |
||
| 77 | $attrs['width'], |
||
| 78 | $attrs['height'], |
||
| 79 | $attrs['cache'], |
||
| 80 | $attrs['linking'] |
||
| 81 | ) |
||
| 82 | ]; |
||
| 83 | break; |
||
| 84 | } |
||
| 85 | case 'resolveImageTitle': |
||
| 86 | { |
||
| 87 | $image = $INPUT->arr('image'); |
||
| 88 | $responseData[$action] = []; |
||
| 89 | $responseData[$action]['data-resolvedImage'] = LinkNode::resolveImageTitle( |
||
| 90 | $ID, |
||
| 91 | $image['id'], |
||
| 92 | $image['title'], |
||
| 93 | $image['align'], |
||
| 94 | $image['width'], |
||
| 95 | $image['height'], |
||
| 96 | $image['cache'] |
||
| 97 | ); |
||
| 98 | break; |
||
| 99 | } |
||
| 100 | default: |
||
| 101 | { |
||
| 102 | dbglog('Unknown action: ' . $INPUT->str('action'), __FILE__ . ': ' . __LINE__); |
||
|
1 ignored issue
–
show
|
|||
| 103 | http_status(400, 'unknown action'); |
||
|
1 ignored issue
–
show
|
|||
| 104 | return; |
||
| 105 | } |
||
| 106 | } |
||
| 107 | } |
||
| 108 | |||
| 109 | echo json_encode($responseData); |
||
| 110 | } |
||
| 203 |
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