diff --git a/main/admin/group_list.php b/main/admin/group_list.php
index f5de4c5729..a94a0fdedd 100755
--- a/main/admin/group_list.php
+++ b/main/admin/group_list.php
@@ -249,7 +249,8 @@ function lock_unlock_user($status, $user_id) {
     }
 
     if (($status_db == '1' OR $status_db == '0') AND is_numeric($user_id)) {
-        $sql = "UPDATE $user_table SET active=".intval($status_db)." WHERE user_id=".intval($user_id)."";
+        $sql = "UPDATE $user_table SET active=".intval($status_db)."
+                WHERE user_id=".intval($user_id)."";
         $result = Database::query($sql);
     }
 
diff --git a/main/admin/user_edit.php b/main/admin/user_edit.php
index 0f2138f5df..80109bdbc8 100755
--- a/main/admin/user_edit.php
+++ b/main/admin/user_edit.php
@@ -396,44 +396,6 @@ if ($form->validate()) {
         $extraFieldValue = new ExtraFieldValue('user');
         $extraFieldValue->saveFieldValues($user);
 
-		/*foreach ($user as $key => $value) {
-			if (substr($key, 0, 6) == 'extra_') {
-                //an extra field
-                //@todo remove this as well as in the profile.php ad put it in a function
-                if (is_array($value) && isset($value['Y']) && isset($value['F']) && isset($value['d'])) {
-                    if (isset($value['H']) && isset($value['i'])) {
-                        // extra field date time
-                        $time = mktime($value['H'],$value['i'],0,$value['F'],$value['d'],$value['Y']);
-                        $value = date('Y-m-d H:i:s',$time);
-                    } else {
-                        // extra field date
-                        $time = mktime(0,0,0,$value['F'],$value['d'],$value['Y']);
-                        $value = date('Y-m-d',$time);
-                    }
-                }
-                // For array $value -> if exists key 'tmp_name' then must not be empty
-                // This avoid delete from user field value table when doesn't upload a file
-                if (is_array($value)) {
-                    if (array_key_exists('tmp_name', $value) && empty($value['tmp_name'])) {
-                        //Nothing to do
-                    } else {
-                        if (array_key_exists('tmp_name', $value)) {
-                            $value['tmp_name'] = Security::filter_filename($value['tmp_name']);
-                        }
-                        if (array_key_exists('name', $value)) {
-                            $value['name'] = Security::filter_filename($value['name']);
-                        }
-                        UserManager::update_extra_field_value($user_id, substr($key, 6), $value);
-                    }
-                } else {
-                    UserManager::update_extra_field_value($user_id, substr($key, 6), $value);
-                }
-            } elseif (strpos($key, 'remove_extra') !== false) {
-                $extra_value = Security::filter_filename(urldecode(key($value)));
-                // To remove from user_field_value and folder
-                UserManager::update_extra_field_value($user_id, substr($key,13), $extra_value);
-            }
-		}*/
 		$tok = Security::get_token();
 		header('Location: user_list.php?action=show_message&message='.urlencode(get_lang('UserUpdated')).'&sec_token='.$tok);
 		exit();
diff --git a/main/dropbox/index.php b/main/dropbox/index.php
index 5cab41cc86..be8822093f 100755
--- a/main/dropbox/index.php
+++ b/main/dropbox/index.php
@@ -71,15 +71,15 @@ if (isset($_POST['submitWork'])) {
 }
 
 // Display the form for adding a category
-if ($action == 'addreceivedcategory' or $action == 'addsentcategory') {
+if ($action == 'addreceivedcategory' || $action == 'addsentcategory') {
 	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
 		api_not_allowed();
 	}
-	display_addcategory_form($_POST['category_name'],'',$_GET['action']);
+	display_addcategory_form($_POST['category_name'], '', $_GET['action']);
 }
 
 // Editing a category: displaying the form
-if ($action == 'editcategory' and isset($_GET['id'])) {
+if ($action == 'editcategory' && isset($_GET['id'])) {
 	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
 		api_not_allowed();
 	}
@@ -108,7 +108,7 @@ if (isset($_POST['StoreCategory'])) {
 
 
 // Move a File
-if (($action == 'movesent' OR $action == 'movereceived') AND isset($_GET['move_id'])) {
+if (($action == 'movesent' || $action == 'movereceived') AND isset($_GET['move_id'])) {
 	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
 		api_not_allowed();
 	}
@@ -127,7 +127,7 @@ if (isset($_POST['do_move'])) {
 }
 
 // Delete a file
-if (($action == 'deletereceivedfile' OR $action == 'deletesentfile') AND isset($_GET['id']) AND is_numeric($_GET['id'])) {
+if (($action == 'deletereceivedfile' || $action == 'deletesentfile') AND isset($_GET['id']) AND is_numeric($_GET['id'])) {
 	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
 		api_not_allowed();
 	}
@@ -144,7 +144,7 @@ if (($action == 'deletereceivedfile' OR $action == 'deletesentfile') AND isset($
 }
 
 // Delete a category
-if (($action == 'deletereceivedcategory' OR $action == 'deletesentcategory') AND isset($_GET['id']) AND is_numeric($_GET['id'])) {
+if (($action == 'deletereceivedcategory' || $action == 'deletesentcategory') AND isset($_GET['id']) AND is_numeric($_GET['id'])) {
 	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
 		api_not_allowed();
 	}
@@ -205,7 +205,7 @@ if ($action != 'add') {
 	}
 
 	// ACTIONS
-	if ($view == 'received' OR !$dropbox_cnf['sent_received_tabs']) {
+	if ($view == 'received' || !$dropbox_cnf['sent_received_tabs']) {
 		//echo '
'.get_lang('ReceivedFiles').'
';
 
 		// This is for the categories
@@ -242,7 +242,7 @@ if ($action != 'add') {
 		}
 	}
 
-	if (!$view OR $view == 'sent' OR !$dropbox_cnf['sent_received_tabs']) {
+	if (!$view || $view == 'sent' || !$dropbox_cnf['sent_received_tabs']) {
 		// This is for the categories
 		if (isset($viewSentCategory) AND $viewSentCategory != '') {
 			$view_dropbox_category_sent = $viewSentCategory;
@@ -284,7 +284,7 @@ if ($action != 'add') {
 	if ($dropbox_cnf['sent_received_tabs']) {
 ?>
 
-    -  >
+    
 -  >
         
 
     -  >
         
 
@@ -294,7 +294,7 @@ if ($action != 'add') {
 
 	/*	RECEIVED FILES */
 
-	if ($view == 'received' OR !$dropbox_cnf['sent_received_tabs']) {
+	if ($view == 'received' || !$dropbox_cnf['sent_received_tabs']) {
 		// This is for the categories
 		if (isset($viewReceivedCategory) AND $viewReceivedCategory != '') {
 			$view_dropbox_category_received = $viewReceivedCategory;
@@ -303,7 +303,8 @@ if ($action != 'add') {
 		}
 
 		// Object initialisation
-		$dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor); // note: are the $is_courseAdmin and $is_courseTutor parameters needed????
+		$dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor);
+		 // note: are the $is_courseAdmin and $is_courseTutor parameters needed????
 
 		// Constructing the array that contains the total number of feedback messages per document.
 		$number_feedback = get_total_number_feedback();
@@ -463,7 +464,7 @@ if ($action != 'add') {
 
 	/*	SENT FILES */
 
-	if (!$view OR $view == 'sent' OR !$dropbox_cnf['sent_received_tabs']) {
+	if (!$view || $view == 'sent' || !$dropbox_cnf['sent_received_tabs']) {
 		// This is for the categories
 		if (isset($viewSentCategory) AND $viewSentCategory != '') {
 			$view_dropbox_category_sent = $viewSentCategory;
@@ -576,7 +577,8 @@ if ($action != 'add') {
 				if ($category['sent'] == '1') {
 
                     $moveList[$category['cat_id']] = $category['cat_name'];
-					$dropbox_category_data[] = $category['cat_id']; // This is where the checkbox icon for the files appear.
+					$dropbox_category_data[] = $category['cat_id'];
+					// This is where the checkbox icon for the files appear.
 					$link_open = '';
 					$dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).'';
 					$dropbox_category_data[] = ''.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).''.$link_open.Security::remove_XSS($category['cat_name']).'';
diff --git a/main/exercice/answer.class.php b/main/exercice/answer.class.php
index e05ae17bce..c991884788 100755
--- a/main/exercice/answer.class.php
+++ b/main/exercice/answer.class.php
@@ -622,19 +622,6 @@ class Answer
             }
         }
 
-        /*if (!empty($answerList)) {
-            foreach ($answerList as $autoId => $counterId) {
-                $sql = "UPDATE $answerTable SET answer = $autoId
-                        WHERE
-                            answer = $counterId AND
-                            c_id = $c_id AND
-                            question_id = $questionId
-                        ";
-
-                Database::query($sql);
-            }
-        }*/
-
         if (count($this->position) > $this->new_nbrAnswers) {
             $i = $this->new_nbrAnswers + 1;
             while ($this->position[$i]) {
diff --git a/main/exercice/exercise_result.php b/main/exercice/exercise_result.php
index 267fa65dfc..5c01916dbf 100755
--- a/main/exercice/exercise_result.php
+++ b/main/exercice/exercise_result.php
@@ -135,16 +135,6 @@ Display :: display_normal_message(get_lang('Saved').'
',false);
 // Display and save questions
 ExerciseLib::display_question_list_by_attempt($objExercise, $exe_id, true);
 
-//If is not valid
-
-/*
-$session_control_key = ExerciseLib::get_session_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id);
-if (isset($session_control_key) && !ExerciseLib::exercise_time_control_is_valid($objExercise->id, $learnpath_id, $learnpath_item_id)) {
-	$TBL_TRACK_ATTEMPT		= Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
-	$sql_fraud = "UPDATE $TBL_TRACK_ATTEMPT SET answer = 0, marks = 0, position = 0 WHERE exe_id = $exe_id ";
-	Database::query($sql_fraud);
-}*/
-
 //Unset session for clock time
 ExerciseLib::exercise_time_control_delete($objExercise->id, $learnpath_id, $learnpath_item_id);
 ExerciseLib::delete_chat_exercise_session($exe_id);
diff --git a/main/exercice/question.class.php b/main/exercice/question.class.php
index 3cc0aa3d1b..6f9a3a1b12 100755
--- a/main/exercice/question.class.php
+++ b/main/exercice/question.class.php
@@ -380,10 +380,7 @@ abstract class Question
                 $res = Database::query($sql);
                 $row = Database::fetch_array($res);
                 if ($row['nb'] > 0) {
-                    //DO nothing
-                    //$sql = "UPDATE $TBL_QUESTION_REL_CATEGORY SET category_id = $category_id
-                    //WHERE question_id=$question_id AND c_id=".api_get_course_int_id();
-                    //$res = Database::query($sql);
+                    // DO nothing
                 } else {
                     $sql = "INSERT INTO $TBL_QUESTION_REL_CATEGORY (c_id, question_id, category_id)
                             VALUES (" . api_get_course_int_id() . ", $question_id, $category_id)";
@@ -910,13 +907,6 @@ abstract class Question
 
         // if the question is created in an exercise
         if ($exerciseId) {
-            /*
-            $sql = 'UPDATE '.Database::get_course_table(TABLE_LP_ITEM).'
-                    SET max_score = '.intval($weighting).'
-                    WHERE item_type = "'.TOOL_QUIZ.'"
-                    AND path='.intval($exerciseId);
-            Database::query($sql);
-            */
             // adds the exercise into the exercise list of this question
             $this->addToList($exerciseId, TRUE);
         }
diff --git a/main/inc/ajax/course_home.ajax.php b/main/inc/ajax/course_home.ajax.php
index a89480e1ac..07b4ae1dcd 100755
--- a/main/inc/ajax/course_home.ajax.php
+++ b/main/inc/ajax/course_home.ajax.php
@@ -49,23 +49,6 @@ switch ($action) {
 
             // HIDE AND REACTIVATE TOOL
             if ($_GET["id"] == strval(intval($_GET["id"]))) {
-
-                /* -- session condition for visibility
-                 if (!empty($session_id)) {
-                    $sql = "select session_id FROM $tool_table WHERE id='".$_GET["id"]."' AND session_id = '$session_id'";
-                    $rs = Database::query($sql);
-                    if (Database::num_rows($rs) > 0) {
-                         $sql="UPDATE $tool_table SET visibility=$requested_visible WHERE id='".$_GET["id"]."' AND session_id = '$session_id'";
-                    } else {
-                        $sql_select = "select * FROM $tool_table WHERE id='".$_GET["id"]."'";
-                        $res_select = Database::query($sql_select);
-                        $row_select = Database::fetch_array($res_select);
-                        $sql = "INSERT INTO $tool_table(name,link,image,visibility,admin,address,added_tool,target,category,session_id)
-                                VALUES('{$row_select['name']}','{$row_select['link']}','{$row_select['image']}','0','{$row_select['admin']}','{$row_select['address']}','{$row_select['added_tool']}','{$row_select['target']}','{$row_select['category']}','$session_id')";
-                    }
-                } else $sql="UPDATE $tool_table SET visibility=$requested_visible WHERE id='".$_GET["id"]."'";
-                */
-
                 $sql = "UPDATE $tool_table SET
                         visibility = $requested_visible
                         WHERE c_id = $course_id AND id='" . intval($_GET['id']) . "'";
diff --git a/main/inc/lib/SequenceManager.php b/main/inc/lib/SequenceManager.php
index dd03775536..18aadbd177 100644
--- a/main/inc/lib/SequenceManager.php
+++ b/main/inc/lib/SequenceManager.php
@@ -1017,10 +1017,6 @@ class SequenceManager
 
         if ($row_entity_id_prev !== 0 || $row_entity_id_next !== 0) {
             $seq_table = Database::get_main_table(TABLE_MAIN_SEQUENCE);
-            // Old code
-
-            /*$sql = "UPDATE $seq_table SET sequence_row_entity_id = $row_entity_id_prev WHERE sequence_row_entity_id_next = $row_entity_id_next";
-            Database::query($sql);*/
 
             // Check if exists.
             $sql = "SELECT count(*) as count FROM $seq_table
diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php
index 4aad5860a8..1a92fb4202 100755
--- a/main/newscorm/learnpath.class.php
+++ b/main/newscorm/learnpath.class.php
@@ -998,22 +998,6 @@ class learnpath
             return false;
         }
         $this->current_time_stop = time();
-        if ($this->save) {
-            /*
-            $learnpath_view_table = Database :: get_course_table(TABLE_LP_VIEW);
-            $sql = "UPDATE $learnpath_view_table " .
-                    "SET " .
-                    "stop_time = ".$this->current_time_stop.", " .
-                    "score = ".$this->current_score.", ".
-                    "WHERE learnpath_id = '".$this->lp_id."'";
-            //$res = Database::query($sql);
-            $res = Database::query($res);
-            if (Database::affected_rows($res) < 1) {
-                $this->error = 'Could not update learnpath_view table while closing learnpath';
-                return false;
-            }
-            */
-        }
         $this->ordered_items = array();
         $this->index = 0;
         unset ($this->lp_id);
diff --git a/tests/main/chat/chat_functions.lib.test.php b/tests/main/chat/chat_functions.lib.test.php
index 4791af8d53..f4da104e12 100755
--- a/tests/main/chat/chat_functions.lib.test.php
+++ b/tests/main/chat/chat_functions.lib.test.php
@@ -43,9 +43,11 @@ class TestChatFunctions extends UnitTestCase {
 		//The user_id exists so we must do an UPDATE and not a INSERT
 		$current_time = date('Y-m-d H:i:s');
 		if (Database::num_rows($result)==0) {
-			$query="INSERT INTO $tbl_chat_connected(user_id,last_connection,session_id) VALUES(1,'$current_time','$session_id')";
+			$query="INSERT INTO $tbl_chat_connected(user_id,last_connection,session_id)
+					VALUES(1,'$current_time','$session_id')";
 		} else {
-			$query="UPDATE $tbl_chat_connected set last_connection='".$current_time."' WHERE user_id=1 AND session_id='$session_id'";
+			$query="UPDATE $tbl_chat_connected set last_connection='".$current_time."'
+					WHERE user_id=1 AND session_id='$session_id'";
 		}
 		Database::query($query);
 	}