Conditions | 1 |
Paths | 1 |
Total Lines | 53 |
Code Lines | 36 |
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 |
||
74 | public function testMenuTree() { |
||
75 | $metadata = $this->defaultCacheMetaData(); |
||
76 | $metadata->addCacheTags(['config:system.menu.test']); |
||
77 | |||
78 | $this->assertResults( |
||
79 | $this->getQueryFromFile('menu.gql'), |
||
80 | [], |
||
81 | [ |
||
82 | 'info' => [ |
||
83 | 'name' => 'Test menu', |
||
84 | 'description' => 'Menu for testing GraphQL menu access.', |
||
85 | ], |
||
86 | 'menu' => [ |
||
87 | 'links' => [ |
||
88 | 0 => [ |
||
89 | 'label' => 'Accessible', |
||
90 | 'route' => [ |
||
91 | 'path' => '/graphql/test/accessible', |
||
92 | 'routed' => TRUE, |
||
93 | ], |
||
94 | 'attribute' => NULL, |
||
95 | 'links' => [ |
||
96 | 0 => [ |
||
97 | 'label' => 'Nested A', |
||
98 | 'attribute' => NULL, |
||
99 | 'route' => [ |
||
100 | 'path' => '/graphql/test/accessible', |
||
101 | 'routed' => TRUE, |
||
102 | ], |
||
103 | ], |
||
104 | 1 => [ |
||
105 | 'label' => 'Nested B', |
||
106 | 'route' => [ |
||
107 | 'path' => '/graphql/test/accessible', |
||
108 | 'routed' => TRUE, |
||
109 | ], |
||
110 | 'attribute' => NULL, |
||
111 | ], |
||
112 | ], |
||
113 | ], |
||
114 | 1 => [ |
||
115 | 'label' => 'Drupal', |
||
116 | 'route' => [ |
||
117 | 'path' => 'http://www.drupal.org', |
||
118 | 'routed' => FALSE, |
||
119 | ], |
||
120 | 'attribute' => NULL, |
||
121 | 'links' => [], |
||
122 | ], |
||
123 | ], |
||
124 | ], |
||
125 | ], |
||
126 | $metadata |
||
127 | ); |
||
131 |
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