Code Duplication    Length = 4-5 lines in 2 locations

code/controllers/DMSDocumentCartController.php 2 locations

@@ 97-100 (lines=4) @@
94
            }
95
        }
96
97
        if ($request->isAjax()) {
98
            $this->response->addHeader('Content-Type', 'application/json');
99
            return Convert::raw2json(array('result' => $result, 'message' => $message));
100
        }
101
102
        if (!$result) {
103
            Session::set('dms-cart-validation-message', $message);
@@ 126-130 (lines=5) @@
123
        $this->getCart()->updateItemQuantity((int)$request->param('ID'), $quantity);
124
        $this->redirectBack();
125
126
        if ($request->isAjax()) {
127
            $this->response->addHeader('Content-Type', 'application/json');
128
129
            return Convert::raw2json(array('result' => true));
130
        }
131
        if ($backURL = $request->getVar('BackURL')) {
132
            return $this->redirect($backURL);
133
        }