Code Duplication    Length = 8-10 lines in 4 locations

system/Inji/Model.php 4 locations

@@ 1045-1052 (lines=8) @@
1042
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1043
        }
1044
        $appType = App::$cur->type;
1045
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1046
            if (!empty($options['appType'])) {
1047
                $appType = $options['appType'];
1048
            }
1049
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1050
        } else {
1051
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1052
        }
1053
        if (!empty($storage[$classPath[1]])) {
1054
            $items = $storage[$classPath[1]];
1055
            $class = get_called_class();
@@ 1085-1094 (lines=10) @@
1082
        } else {
1083
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1084
        }
1085
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1086
            if (empty($options['appType'])) {
1087
                $appType = App::$cur->type;
1088
            } else {
1089
                $appType = $options['appType'];
1090
            }
1091
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1092
        } else {
1093
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1094
        }
1095
        if (!empty($storage[$classPath[1]])) {
1096
            $items = [];
1097
            $class = get_called_class();
@@ 1377-1386 (lines=10) @@
1374
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1375
        }
1376
1377
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1378
            if (empty($options['appType'])) {
1379
                $appType = App::$cur->type;
1380
            } else {
1381
                $appType = $options['appType'];
1382
            }
1383
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1384
        } else {
1385
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1386
        }
1387
        if (empty($storage[$classPath[1]])) {
1388
            $storage[$classPath[1]] = [];
1389
        }
@@ 1580-1589 (lines=10) @@
1577
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1578
        }
1579
1580
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1581
            if (empty($options['appType'])) {
1582
                $appType = App::$cur->type;
1583
            } else {
1584
                $appType = $options['appType'];
1585
            }
1586
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1587
        } else {
1588
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1589
        }
1590
        if (empty($storage[$classPath[1]])) {
1591
            $storage[$classPath[1]] = [];
1592
        }