Code Duplication    Length = 3-3 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 272-274 (lines=3) @@
269
270
        // CSRF check
271
        $token = SecurityToken::inst();
272
        if (empty($vars[$token->getName()]) || !$token->check($vars[$token->getName()])) {
273
            return new SS_HTTPResponse(null, 400);
274
        }
275
276
        if (!isset($vars['ids']) || !$vars['ids']) {
277
            return (new SS_HTTPResponse(json_encode(['status' => 'error']), 400))
@@ 318-320 (lines=3) @@
315
316
        // CSRF check
317
        $token = SecurityToken::inst();
318
        if (empty($data[$token->getName()]) || !$token->check($data[$token->getName()])) {
319
            return new SS_HTTPResponse(null, 400);
320
        }
321
322
        // check canAddChildren permissions
323
        if (!empty($data['ParentID']) && is_numeric($data['ParentID'])) {
@@ 379-381 (lines=3) @@
376
377
        // CSRF check
378
        $token = SecurityToken::inst();
379
        if (empty($data[$token->getName()]) || !$token->check($data[$token->getName()])) {
380
            return new SS_HTTPResponse(null, 400);
381
        }
382
383
        // check addchildren permissions
384
        if (!empty($data['ParentID']) && is_numeric($data['ParentID'])) {