Code Duplication    Length = 4-5 lines in 5 locations

src/base/extension/AssetsParser.php 4 locations

@@ 47-50 (lines=4) @@
44
    protected static function calculateResourcePathname($filename_path, $source)
45
    {
46
        $source_file = preg_replace("/'/", "", $source[1]);
47
        if (preg_match('/\#/', $source_file)) {
48
            $source_file = explode("#", $source_file);
49
            $source_file = $source_file[0];
50
        }
51
        if (preg_match('/\?/', $source_file)) {
52
            $source_file = explode("?", $source_file);
53
            $source_file = $source_file[0];
@@ 51-54 (lines=4) @@
48
            $source_file = explode("#", $source_file);
49
            $source_file = $source_file[0];
50
        }
51
        if (preg_match('/\?/', $source_file)) {
52
            $source_file = explode("?", $source_file);
53
            $source_file = $source_file[0];
54
        }
55
        $orig = realpath(dirname($filename_path).DIRECTORY_SEPARATOR.$source_file);
56
        return $orig;
57
    }
@@ 428-431 (lines=4) @@
425
    protected function extractSourceFilename($source)
426
    {
427
        $source_file = preg_replace("/'/", "", $source[1]);
428
        if (preg_match('/\#/', $source_file)) {
429
            $source_file = explode("#", $source_file);
430
            $source_file = $source_file[0];
431
        }
432
        if (preg_match('/\?/', $source_file)) {
433
            $source_file = explode("?", $source_file);
434
            $source_file = $source_file[0];
@@ 432-436 (lines=5) @@
429
            $source_file = explode("#", $source_file);
430
            $source_file = $source_file[0];
431
        }
432
        if (preg_match('/\?/', $source_file)) {
433
            $source_file = explode("?", $source_file);
434
            $source_file = $source_file[0];
435
            return $source_file;
436
        }
437
        return $source_file;
438
    }
439

src/services/DocumentorService.php 1 location

@@ 182-185 (lines=4) @@
179
            $docs = explode("\n", $comments);
180
            if (count($docs)) {
181
                foreach ($docs as &$doc) {
182
                    if (!preg_match('/(\*\*|\@)/i', $doc) && preg_match('/\*\ /i', $doc)) {
183
                        $doc = explode('* ', $doc);
184
                        $description = $doc[1];
185
                    }
186
                }
187
            }
188