Code Duplication    Length = 8-10 lines in 4 locations

system/Inji/Model.php 4 locations

@@ 925-932 (lines=8) @@
922
      $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
923
    }
924
    $appType = App::$cur->type;
925
    if (!empty($moduleConfig['storage']['appTypeSplit'])) {
926
      if (!empty($options['appType'])) {
927
        $appType = $options['appType'];
928
      }
929
      $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
930
    } else {
931
      $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
932
    }
933
    if (!empty($storage[$classPath[1]])) {
934
      $items = $storage[$classPath[1]];
935
      $class = get_called_class();
@@ 965-974 (lines=10) @@
962
    } else {
963
      $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
964
    }
965
    if (!empty($moduleConfig['storage']['appTypeSplit'])) {
966
      if (empty($options['appType'])) {
967
        $appType = App::$cur->type;
968
      } else {
969
        $appType = $options['appType'];
970
      }
971
      $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
972
    } else {
973
      $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
974
    }
975
    if (!empty($storage[$classPath[1]])) {
976
      $items = [];
977
      $class = get_called_class();
@@ 1254-1263 (lines=10) @@
1251
      $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1252
    }
1253
1254
    if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1255
      if (empty($options['appType'])) {
1256
        $appType = App::$cur->type;
1257
      } else {
1258
        $appType = $options['appType'];
1259
      }
1260
      $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1261
    } else {
1262
      $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1263
    }
1264
    if (empty($storage[$classPath[1]])) {
1265
      $storage[$classPath[1]] = [];
1266
    }
@@ 1457-1466 (lines=10) @@
1454
      $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1455
    }
1456
1457
    if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1458
      if (empty($options['appType'])) {
1459
        $appType = App::$cur->type;
1460
      } else {
1461
        $appType = $options['appType'];
1462
      }
1463
      $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1464
    } else {
1465
      $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1466
    }
1467
    if (empty($storage[$classPath[1]])) {
1468
      $storage[$classPath[1]] = [];
1469
    }