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
@@ 399-418 (lines=20) @@
396
     * @access private
397
     * @copyright ImageCMS (c) 2013, Kaero <[email protected]>
398
     */
399
    private function buildStylePath($fileName) {
400
        if (!$this->template) {
401
            $this->template = CI_Controller::get_instance()->config->item('template');
402
        }
403
404
        $moduleName = $this->getTrace();
405
        $path = sprintf('templates/%s/%s/css/%s.css', $this->template, $moduleName, $fileName);
406
        if (file_exists($path)) {
407
            $url = $path;
408
        } else {
409
            $url = $this->getModuleFilePath(
410
                [
411
                 sprintf('%s/assets/css/%s.css', $moduleName, $fileName),
412
                 sprintf('%s/assets/css/%s.css', CI::$APP->uri->segment(4), $fileName),
413
                ],
414
                false
415
            );
416
        }
417
        return str_replace(MAINSITE, '', $url);
418
    }
419
420
    /**
421
     * Render public view