Code Duplication    Length = 4-5 lines in 5 locations

src/base/extension/AssetsParser.php 4 locations

@@ 50-53 (lines=4) @@
47
    protected static function calculateResourcePathname($filename_path, $source)
48
    {
49
        $source_file = preg_replace("/'/", "", $source[1]);
50
        if (preg_match('/\#/', $source_file)) {
51
            $source_file = explode("#", $source_file);
52
            $source_file = $source_file[0];
53
        }
54
        if (preg_match('/\?/', $source_file)) {
55
            $source_file = explode("?", $source_file);
56
            $source_file = $source_file[0];
@@ 54-57 (lines=4) @@
51
            $source_file = explode("#", $source_file);
52
            $source_file = $source_file[0];
53
        }
54
        if (preg_match('/\?/', $source_file)) {
55
            $source_file = explode("?", $source_file);
56
            $source_file = $source_file[0];
57
        }
58
        $orig = realpath(dirname($filename_path) . DIRECTORY_SEPARATOR . $source_file);
59
        return $orig;
60
    }
@@ 456-459 (lines=4) @@
453
    protected function extractSourceFilename($source)
454
    {
455
        $source_file = preg_replace("/'/", "", $source[1]);
456
        if (preg_match('/\#/', $source_file)) {
457
            $source_file = explode("#", $source_file);
458
            $source_file = $source_file[0];
459
        }
460
        if (preg_match('/\?/', $source_file)) {
461
            $source_file = explode("?", $source_file);
462
            $source_file = $source_file[0];
@@ 460-464 (lines=5) @@
457
            $source_file = explode("#", $source_file);
458
            $source_file = $source_file[0];
459
        }
460
        if (preg_match('/\?/', $source_file)) {
461
            $source_file = explode("?", $source_file);
462
            $source_file = $source_file[0];
463
            return $source_file;
464
        }
465
        return $source_file;
466
    }
467

src/services/DocumentorService.php 1 location

@@ 203-206 (lines=4) @@
200
        $docs = explode("\n", $comments);
201
        if (count($docs)) {
202
            foreach ($docs as &$doc) {
203
                if (!preg_match('/(\*\*|\@)/i', $doc) && preg_match('/\*\ /i', $doc)) {
204
                    $doc = explode('* ', $doc);
205
                    $description = $doc[1];
206
                }
207
            }
208
        }
209