| Conditions | 1 |
| Paths | 1 |
| Total Lines | 109 |
| Code Lines | 98 |
| 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 |
||
| 197 | private function cleaningMD($textMD, $baseUrl) |
||
| 198 | {
|
||
| 199 | $baseUrl = \str_replace('/blob/', '/raw/', $baseUrl);
|
||
| 200 | |||
| 201 | $contentClean = \str_replace('http://', 'https://', $textMD);
|
||
| 202 | |||
| 203 | //replace image links |
||
| 204 | $arrSearch = [ |
||
| 205 | 'src="https://xoops.org/images/logoXoopsPhp8_400.png', |
||
| 206 | "src='https://xoops.org/images/logoXoopsPhp8_400.png", |
||
| 207 | 'src=".gitbook/assets/', |
||
| 208 | "src='.gitbook/assets/", |
||
| 209 | 'src="en/assets/', |
||
| 210 | "src='en/assets/", |
||
| 211 | 'src="assets/', |
||
| 212 | "src='assets/" |
||
| 213 | ]; |
||
| 214 | $arrReplace = [ |
||
| 215 | 'src="https://xoops.org/images/logoXoopsPhp8.png', |
||
| 216 | "src='https://xoops.org/images/logoXoopsPhp8.png", |
||
| 217 | 'src="' . $baseUrl . '.gitbook/assets/', |
||
| 218 | "src='" . $baseUrl . '.gitbook/assets/', |
||
| 219 | 'src="' . $baseUrl . 'en/assets/', |
||
| 220 | "src='" . $baseUrl . 'en/assets/', |
||
| 221 | 'src="' . $baseUrl . 'assets/', |
||
| 222 | "src='" . $baseUrl . 'assets/' |
||
| 223 | ]; |
||
| 224 | $contentClean = \str_replace($arrSearch, $arrReplace, $contentClean); |
||
| 225 | |||
| 226 | //replace known missing images |
||
| 227 | $arrSearch = [ |
||
| 228 | 'src="' . XOOPS_URL . '/screenshot.jpg', |
||
| 229 | 'src="' . XOOPS_URL . '/sd-099-theme-surprice.gif', |
||
| 230 | 'src="' . XOOPS_URL . '/shot.gif', |
||
| 231 | 'src="' . XOOPS_URL . '/shot.jpg', |
||
| 232 | 'src="' . XOOPS_URL . '/theme_preview.png', |
||
| 233 | 'src="https://github.com/xoops/newbb-tutorial/tree/54ef6104e66b74e8c6dea683d3cce70ceafdd739/assets/image001.jpg', |
||
| 234 | 'src="https://github.com/xoops/repairshop-tutorial/tree/719d6d32dea221b3e980fd3d6222f179ac898394/en/assets/img_2.jpg', |
||
| 235 | 'src="https://github.com/xoops/xoops-mylinks-tutorial/tree/d30c30645d48c5ead51399ff711c25935cbd0495/en/assets/forkit.png', |
||
| 236 | 'src="https://github.com/xoops/xoopspartners-tutorial/tree/f41bf73b884ccd906dc6a8323363b9b1aa3f8d02/en/assets/forkit.png', |
||
| 237 | 'src="https://github.com/XoopsDocs/adslight-tutorial/raw/master/en/assets/image001.png', |
||
| 238 | 'src="https://github.com/XoopsDocs/avaman-tutorial/raw/master/en/assets/image001.png', |
||
| 239 | 'src="https://github.com/XoopsDocs/extgallery-tutorial/raw/master/en/assets/forkit.png', |
||
| 240 | 'src="https://github.com/XoopsDocs/extgallery-tutorial/raw/master/en/assets/image001.png', |
||
| 241 | 'src="https://github.com/XoopsDocs/presenter-tutorial/raw/master/en/assets/image001.png', |
||
| 242 | 'src="https://github.com/XoopsDocs/smartpartner-tutorial/raw/master/en/assets/image001.png', |
||
| 243 | 'src="https://github.com/XoopsDocs/tag-tutorial/raw/master/en/assets/image001.png', |
||
| 244 | 'src="https://github.com/XoopsDocs/wfdownloads-tutorial/raw/master/en/assets/forkit.png', |
||
| 245 | 'src="https://github.com/XoopsDocs/wfdownloads-tutorial/raw/master/en/assets/image001.png', |
||
| 246 | 'src="https://github.com/XoopsDocs/xasset-tutorial/tree/9b95bc0ae0219c95a8cf16e77b9cd2175d856e89/en/assets/image001.png', |
||
| 247 | 'src="https://github.com/XoopsDocs/xoops_codex/raw/master/en/assets/image001.png', |
||
| 248 | 'src="https://img.shields.io/codeclimate/github/mambax7/adslight.svg?style=flat', |
||
| 249 | 'src="https://img.shields.io/codeclimate/github/mambax7/avaman.svg?style=flat', |
||
| 250 | 'src="https://img.shields.io/codeclimate/github/mambax7/extcal.svg?style=flat', |
||
| 251 | 'src="https://img.shields.io/codeclimate/github/mambax7/extgallery.svg?style=flat', |
||
| 252 | 'src="https://img.shields.io/codeclimate/github/mambax7/gbook.svg?style=flat', |
||
| 253 | 'src="https://img.shields.io/codeclimate/github/mambax7/marquee.svg?style=flat', |
||
| 254 | 'src="https://img.shields.io/codeclimate/github/mambax7/mastopgo2.svg?style=flat', |
||
| 255 | 'src="https://img.shields.io/codeclimate/github/mambax7/moduleinstaller.svg?style=flat', |
||
| 256 | 'src="https://img.shields.io/codeclimate/github/mambax7/myconference.svg?style=flat', |
||
| 257 | 'src="https://img.shields.io/codeclimate/github/mambax7/newbb.svg?style=flat', |
||
| 258 | 'src="https://img.shields.io/codeclimate/github/mambax7/planet.svg?style=flat', |
||
| 259 | 'src="https://img.shields.io/codeclimate/github/mambax7/publisher.svg?style=flat', |
||
| 260 | 'src="https://img.shields.io/codeclimate/github/mambax7/randomquote.svg?style=flat', |
||
| 261 | 'src="https://img.shields.io/codeclimate/github/mambax7/references/.svg?style=flat', |
||
| 262 | 'src="https://img.shields.io/codeclimate/github/mambax7/smartfaq.svg?style=flat', |
||
| 263 | 'src="https://img.shields.io/codeclimate/github/mambax7/smartpartner.svg?style=flat', |
||
| 264 | 'src="https://img.shields.io/codeclimate/github/mambax7/suico.svg?style=flat', |
||
| 265 | 'src="https://img.shields.io/codeclimate/github/mambax7/tdmpicture.svg?style=flat', |
||
| 266 | 'src="https://img.shields.io/codeclimate/github/mambax7/waiting.svg?style=flat', |
||
| 267 | 'src="https://img.shields.io/codeclimate/github/mambax7/wflinks.svg?style=flat', |
||
| 268 | 'src="https://img.shields.io/codeclimate/github/mambax7/xfaq.svg?style=flat', |
||
| 269 | 'src="https://img.shields.io/codeclimate/github/mambax7/xoopsheadline.svg?style=flat', |
||
| 270 | 'src="https://img.shields.io/codeclimate/github/mambax7/xoopspoll.svg?style=flat', |
||
| 271 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/about.svg?style=flat', |
||
| 272 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/adminer.svg?style=flat', |
||
| 273 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/contact.svg?style=flat', |
||
| 274 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/content.svg?style=flat', |
||
| 275 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/cssholmes.svg?style=flat', |
||
| 276 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/lexikon.svg?style=flat', |
||
| 277 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/myiframe.svg?style=flat', |
||
| 278 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/mylinks.svg?style=flat', |
||
| 279 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/mymenus.svg?style=flat', |
||
| 280 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/news.svg?style=flat', |
||
| 281 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/smallworld.svg?style=flat', |
||
| 282 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/soapbox.svg?style=flat', |
||
| 283 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/tag.svg?style=flat', |
||
| 284 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/tdmdownloads.svg?style=flat', |
||
| 285 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/userlog.svg?style=flat', |
||
| 286 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xbssacc.svg?style=flat', |
||
| 287 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xbstags.svg?style=flat', |
||
| 288 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xbsvat.svg?style=flat', |
||
| 289 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xfguestbook.svg?style=flat', |
||
| 290 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xlanguage.svg?style=flat', |
||
| 291 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xmfdemo.svg?style=flat', |
||
| 292 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xoopsfaq.svg?style=flat', |
||
| 293 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xoopshp.svg?style=flat', |
||
| 294 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xoopsinfo.svg?style=flat', |
||
| 295 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xoopspartners.svg?style=flat', |
||
| 296 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xoopstube.svg?style=flat', |
||
| 297 | 'src="https://img.shields.io/codeclimate/github/XoopsModules25x/xsitemap.svg?style=flat', |
||
| 298 | 'src="https://img.shields.io/github/release/mambax7/references/.svg?style=flat', |
||
| 299 | 'src="https://img.shields.io/github/tag/mambax7/references/.svg?style=flat', |
||
| 300 | 'src="https://insight.sensiolabs.com/projects/7ada0220-a68e-4369-aef0-950172630ff8/mini.png', |
||
| 301 | 'src="https://xoops.org/images/translations-github-blue.svg', |
||
| 302 | ]; |
||
| 303 | $contentClean = \str_replace($arrSearch, 'src="' . WGGITHUB_IMAGE_URL . '/blank.gif', $contentClean); |
||
| 304 | |||
| 305 | return $contentClean; |
||
| 306 | } |
||
| 308 |
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