Code Duplication    Length = 8-10 lines in 4 locations

system/Inji/Model.php 4 locations

@@ 880-887 (lines=8) @@
877
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
878
        }
879
        $appType = App::$cur->type;
880
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
881
            if (!empty($options['appType'])) {
882
                $appType = $options['appType'];
883
            }
884
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
885
        } else {
886
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
887
        }
888
        if (!empty($storage[$classPath[1]])) {
889
            $items = $storage[$classPath[1]];
890
            $class = get_called_class();
@@ 919-928 (lines=10) @@
916
        } else {
917
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
918
        }
919
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
920
            if (empty($options['appType'])) {
921
                $appType = App::$cur->type;
922
            } else {
923
                $appType = $options['appType'];
924
            }
925
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
926
        } else {
927
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
928
        }
929
        if (!empty($storage[$classPath[1]])) {
930
            $items = [];
931
            $class = get_called_class();
@@ 1206-1215 (lines=10) @@
1203
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1204
        }
1205
1206
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1207
            if (empty($options['appType'])) {
1208
                $appType = App::$cur->type;
1209
            } else {
1210
                $appType = $options['appType'];
1211
            }
1212
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1213
        } else {
1214
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1215
        }
1216
        if (empty($storage[$classPath[1]])) {
1217
            $storage[$classPath[1]] = [];
1218
        }
@@ 1409-1418 (lines=10) @@
1406
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1407
        }
1408
1409
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1410
            if (empty($options['appType'])) {
1411
                $appType = App::$cur->type;
1412
            } else {
1413
                $appType = $options['appType'];
1414
            }
1415
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1416
        } else {
1417
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1418
        }
1419
        if (empty($storage[$classPath[1]])) {
1420
            $storage[$classPath[1]] = [];
1421
        }