Conditions | 1 |
Paths | 1 |
Total Lines | 60 |
Code Lines | 20 |
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 |
||
73 | final public function test_rur(): void { |
||
74 | $request = new TestRequest(); |
||
75 | $response = $request->get(array('id' => 'rur')); |
||
76 | self::assertNotNull($response); |
||
77 | |||
78 | $_content = $response->getContent(); |
||
79 | self::assertStringContainsString('Rur', $_content); |
||
80 | self::assertStringContainsString('<script defer="defer" src="/lib/plugins/openlayersmap/ol/ol.js"></script>', $_content); |
||
81 | self::assertStringContainsString('<div id="olMap-static" class="olStaticMap">', $_content); |
||
82 | self::assertStringContainsString('<table id="olMap-table" class="olPOItable">', $_content); |
||
83 | |||
84 | // <img src="/./lib/exe/fetch.php?w=650&h=550&tok=72bf3a&media=olmapmaps:openstreetmap:13:cache_8b:9b:94cd3dabd2d1c470a2d5b4bea6df.png" |
||
85 | // class="medialeft" loading="lazy" title="Rur parkings " alt="Rur parkings " width="650" height="550" /> |
||
86 | $_staticImage = $response->queryHTML('img[src*="olmapmaps:openstreetmap:13:cache_8b:9b:94cd3dabd2d1c470a2d5b4bea6df.png"]'); |
||
87 | self::assertNotEmpty($_staticImage); |
||
88 | self::assertEquals('medialeft', $_staticImage->attr('class')); |
||
89 | self::assertEquals('650', $_staticImage->attr('width')); |
||
90 | self::assertEquals('550', $_staticImage->attr('height')); |
||
91 | self::assertStringContainsString('Rur parkings', $_staticImage->attr('title')); |
||
92 | |||
93 | // <div class="olPOItableSpan" id="olMap-table-span">\n |
||
94 | // <table class="olPOItable" id="olMap-table">\n |
||
95 | // <caption class="olPOITblCaption">Points of Interest</caption>\n |
||
96 | // <thead class="olPOITblHeader">\n |
||
97 | // <tr>\n |
||
98 | // <th class="rowId" scope="col">id</th>\n |
||
99 | // <th class="icon" scope="col">symbol</th>\n |
||
100 | // <th class="lat" scope="col" title="latitude in decimal degrees">latitude</th>\n |
||
101 | // <th class="lon" scope="col" title="longitude in decimal degrees">longitude</th>\n |
||
102 | // <th class="txt" scope="col">description</th>\n |
||
103 | // </tr>\n |
||
104 | // </thead><tfoot class="olPOITblFooter"><tr><td colspan="5">Rur parkings</td></tr></tfoot><tbody class="olPOITblBody">\n |
||
105 | // <tr>\n |
||
106 | // <td class="rowId">1</td>\n |
||
107 | // <td class="icon"><img src="/./lib/plugins/openlayersmap/icons/parking.png" alt="parking" /></td>\n |
||
108 | // <td class="lat" title="latitude in decimal degrees">50.548611º</td>\n |
||
109 | // <td class="lon" title="longitude in decimal degrees">6.228889º</td>\n |
||
110 | // <td class="txt"><p>Parking Dreistegen</p></td>\n |
||
111 | // </tr>\n |
||
112 | // <tr>\n |
||
113 | // <td class="rowId">2</td>\n |
||
114 | // <td class="icon"><img src="/./lib/plugins/openlayersmap/icons/parking.png" alt="parking" /></td>\n |
||
115 | // <td class="lat" title="latitude in decimal degrees">50.56384º</td>\n |
||
116 | // <td class="lon" title="longitude in decimal degrees">6.29766º</td>\n |
||
117 | // <td class="txt"><p>Parking Grünenthalstrasse</p></td>\n |
||
118 | // </tr></tbody>\n |
||
119 | // </table>\n |
||
120 | // </div>\n |
||
121 | |||
122 | $_latCells = $response->queryHTML('td[class="lat"]'); |
||
123 | self::assertNotEmpty($_latCells); |
||
124 | // not available in "stable" |
||
125 | // self::assertEquals('50.548611º', $_latCells->first()->text()); |
||
126 | self::assertEquals('50.548611º', $_latCells->get(0)->textContent); |
||
127 | |||
128 | $_lonCells = $response->queryHTML('td[class="lon"]'); |
||
129 | self::assertNotEmpty($_lonCells); |
||
130 | // not available in "stable" |
||
131 | // self::assertEquals('6.29766º', $_lonCells->last()->text()); |
||
132 | self::assertEquals('6.29766º', $_lonCells->get(1)->textContent); |
||
133 | } |
||
157 | } |
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