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
    }
@@ 425-428 (lines=4) @@
422
    protected function extractSourceFilename($source)
423
    {
424
        $source_file = preg_replace("/'/", "", $source[1]);
425
        if (preg_match('/\#/', $source_file)) {
426
            $source_file = explode("#", $source_file);
427
            $source_file = $source_file[0];
428
        }
429
        if (preg_match('/\?/', $source_file)) {
430
            $source_file = explode("?", $source_file);
431
            $source_file = $source_file[0];
@@ 429-433 (lines=5) @@
426
            $source_file = explode("#", $source_file);
427
            $source_file = $source_file[0];
428
        }
429
        if (preg_match('/\?/', $source_file)) {
430
            $source_file = explode("?", $source_file);
431
            $source_file = $source_file[0];
432
            return $source_file;
433
        }
434
        return $source_file;
435
    }
436

src/services/DocumentorService.php 1 location

@@ 162-165 (lines=4) @@
159
            $docs = explode("\n", $comments);
160
            if (count($docs)) {
161
                foreach ($docs as &$doc) {
162
                    if (!preg_match('/(\*\*|\@)/i', $doc) && preg_match('/\*\ /i', $doc)) {
163
                        $doc = explode('* ', $doc);
164
                        $description = $doc[1];
165
                    }
166
                }
167
            }
168