Code Duplication    Length = 19-20 lines in 2 locations

application/modules/CMSFactory/assetManager.php 2 locations

@@ 244-262 (lines=19) @@
241
     * @access private
242
     * @copyright ImageCMS (c) 2013, Kaero <[email protected]>
243
     */
244
    private function buildScriptPath($fileName) {
245
        $this->template = CI_Controller::get_instance()->config->item('template');
246
247
        $moduleName = $this->getTrace();
248
        $path = sprintf('templates/%s/%s/js/%s.js', $this->template, $moduleName, $fileName);
249
        if (file_exists($path)) {
250
            $url = $path;
251
        } else {
252
            $url = $this->getModuleFilePath(
253
                [
254
                 sprintf('%s/assets/js/%s.js', $moduleName, $fileName),
255
                 sprintf('%s/assets/js/%s.js', CI::$APP->uri->segment(4), $fileName),
256
                ],
257
                false
258
            );
259
        }
260
261
        return str_replace(MAINSITE, '', $url);
262
    }
263
264
    /**
265
     * @param string $list
@@ 420-439 (lines=20) @@
417
     * @access private
418
     * @copyright ImageCMS (c) 2013, Kaero <[email protected]>
419
     */
420
    private function buildStylePath($fileName) {
421
        if (!$this->template) {
422
            $this->template = CI_Controller::get_instance()->config->item('template');
423
        }
424
425
        $moduleName = $this->getTrace();
426
        $path = sprintf('templates/%s/%s/css/%s.css', $this->template, $moduleName, $fileName);
427
        if (file_exists($path)) {
428
            $url = $path;
429
        } else {
430
            $url = $this->getModuleFilePath(
431
                [
432
                 sprintf('%s/assets/css/%s.css', $moduleName, $fileName),
433
                 sprintf('%s/assets/css/%s.css', CI::$APP->uri->segment(4), $fileName),
434
                ],
435
                false
436
            );
437
        }
438
        return str_replace(MAINSITE, '', $url);
439
    }
440
441
    /**
442
     * Render public view