Code Duplication    Length = 8-10 lines in 4 locations

system/Inji/Model.php 4 locations

@@ 1168-1177 (lines=10) @@
1165
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1166
        }
1167
1168
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1169
            if (empty($options['appType'])) {
1170
                $appType = App::$cur->type;
1171
            } else {
1172
                $appType = $options['appType'];
1173
            }
1174
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1175
        } else {
1176
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1177
        }
1178
        if (empty($storage[$classPath[1]])) {
1179
            $storage[$classPath[1]] = [];
1180
        }
@@ 1371-1380 (lines=10) @@
1368
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1369
        }
1370
1371
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1372
            if (empty($options['appType'])) {
1373
                $appType = App::$cur->type;
1374
            } else {
1375
                $appType = $options['appType'];
1376
            }
1377
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1378
        } else {
1379
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1380
        }
1381
        if (empty($storage[$classPath[1]])) {
1382
            $storage[$classPath[1]] = [];
1383
        }
@@ 842-849 (lines=8) @@
839
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
840
        }
841
        $appType = App::$cur->type;
842
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
843
            if (!empty($options['appType'])) {
844
                $appType = $options['appType'];
845
            }
846
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
847
        } else {
848
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
849
        }
850
        if (!empty($storage[$classPath[1]])) {
851
            $items = $storage[$classPath[1]];
852
            $class = get_called_class();
@@ 881-890 (lines=10) @@
878
        } else {
879
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
880
        }
881
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
882
            if (empty($options['appType'])) {
883
                $appType = App::$cur->type;
884
            } else {
885
                $appType = $options['appType'];
886
            }
887
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
888
        } else {
889
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
890
        }
891
        if (!empty($storage[$classPath[1]])) {
892
            $items = [];
893
            $class = get_called_class();