Passed
Push — master ( 4791a8...56927d )
by Julito
09:52
created

switch_item_details()   F

Complexity

Conditions 25
Paths > 20000

Size

Total Lines 252
Code Lines 159

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 25
eloc 159
nc 143616
nop 5
dl 0
loc 252
rs 0
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
6
/**
7
 * This script contains the server part of the xajax interaction process. The client part is located
8
 * in lp_api.php or other api's.
9
 * This is a first attempt at using xajax and AJAX in general, so the code might be a bit unsettling.
10
 *
11
 * @author Yannick Warnier <[email protected]>
12
 */
13
14
// Flag to allow for anonymous user - needs to be set before global.inc.php
15
$use_anonymous = true;
16
require_once __DIR__.'/../inc/global.inc.php';
17
18
echo ScormApi::switchItem(
19
    $_REQUEST['lid'],
20
    $_REQUEST['uid'],
21
    $_REQUEST['vid'],
22
    $_REQUEST['iid'],
23
    $_REQUEST['next']
24
);
25