Passed
Branch master (7a17e1)
by Vitalii
08:27
created
html/user/team_join_action.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,6 +148,6 @@
 block discarded – undo
148 148
 
149 149
 page_tail();
150 150
 
151
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
151
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
152 152
 
153 153
 ?>
Please login to merge, or discard this patch.
html/ops/bolt_map.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@
 block discarded – undo
243 243
             <td><br></td>
244 244
             <td><br></td>
245 245
         ";
246
-    } else  {
246
+    } else {
247 247
         $c = class_name($class);
248 248
         echo "
249 249
             <td><b>".spaces($level)."$unit->name</b></td>
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
 function spaces($level) {
105 105
     $x = "";
106
-    for ($i=0; $i<$level; $i++) {
106
+    for ($i = 0; $i < $level; $i++) {
107 107
         $x .= "&nbsp;&nbsp;&nbsp;&nbsp;";
108 108
     }
109 109
     return $x;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 function avg_score($array) {
137 137
     $sum = 0;
138 138
     $n = count($array);
139
-    if ($n ==0) return 0;
139
+    if ($n == 0) return 0;
140 140
     foreach ($array as $a) {
141 141
         $sum += $a->score;
142 142
     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             $n++;
153 153
         }
154 154
     }
155
-    if ($n ==0) return 0;
155
+    if ($n == 0) return 0;
156 156
     return $sum/$n;
157 157
 }
158 158
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
     global $breakdown, $breakdown_cat;
236 236
     global $rownum, $course_id;
237 237
 
238
-    $a = $is_answer?" (answer)":"";
238
+    $a = $is_answer ? " (answer)" : "";
239 239
     $j = ($rownum++)%2;
240 240
     echo "<tr class=row$j>";
241 241
     if ($breakdown && $breakdown_cat) {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
             <td><br></td>
244 244
             <td><br></td>
245 245
         ";
246
-    } else  {
246
+    } else {
247 247
         $c = class_name($class);
248 248
         echo "
249 249
             <td><b>".spaces($level)."$unit->name</b></td>
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         echo time_graph($t, 200);
278 278
         break;
279 279
     case "BoltExercise":
280
-        $mode = $is_answer?BOLT_MODE_ANSWER:BOLT_MODE_SHOW;
280
+        $mode = $is_answer ?BOLT_MODE_ANSWER:BOLT_MODE_SHOW;
281 281
         $views = get_views($unit, $mode);
282 282
         $n = count($views);
283 283
         $out = outcomes($views);
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
     show_unit($unit, $level);
361 361
     if ($unit->is_item) return;
362 362
     foreach ($unit->units as $u) {
363
-        show_unit_recurse($u, $level+1);
363
+        show_unit_recurse($u, $level + 1);
364 364
     }
365 365
 }
366 366
 
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
         <input type=hidden name=course_id value=$course_id>
403 403
         <table width=600><tr><td valign=top>
404 404
     ";
405
-    filter_form($filter?$filter->name():"", $filter_cat);
405
+    filter_form($filter ? $filter->name() : "", $filter_cat);
406 406
     echo "</td><td valign=top>";
407
-    breakdown_form($breakdown?$breakdown->name():"");
407
+    breakdown_form($breakdown ? $breakdown->name() : "");
408 408
     echo "
409 409
         </td></tr></table>
410 410
         <p>
Please login to merge, or discard this patch.
html/ops/manage_apps.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     $n = post_str("fraction_done_exact", true)?1:0;
50 50
     $app->update("fraction_done_exact=$n");
51 51
 
52
-    echo "Application $id updated.
52
+    echo "application $id updated.
53 53
         <p>
54 54
         You must restart the project for this to take effect.
55 55
     ";
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     $app = BoincApp::lookup_id($id);
26 26
     if (!$app) admin_error_page("no such app");
27 27
 
28
-    $n = post_str("deprecated", true)?1:0;
28
+    $n = post_str("deprecated", true) ? 1 : 0;
29 29
     $app->update("deprecated=$n");
30 30
 
31 31
     $n = post_num("weight");
@@ -37,16 +37,16 @@  discard block
 block discarded – undo
37 37
     $n = post_int("target_nresults");
38 38
     $app->update("target_nresults=$n");
39 39
 
40
-    $n = post_str("homogeneous_app_version", true)?1:0;
40
+    $n = post_str("homogeneous_app_version", true) ? 1 : 0;
41 41
     $app->update("homogeneous_app_version=$n");
42 42
 
43
-    $n = post_str("non_cpu_intensive", true)?1:0;
43
+    $n = post_str("non_cpu_intensive", true) ? 1 : 0;
44 44
     $app->update("non_cpu_intensive=$n");
45 45
 
46
-    $n = post_str("beta", true)?1:0;
46
+    $n = post_str("beta", true) ? 1 : 0;
47 47
     $app->update("beta=$n");
48 48
 
49
-    $n = post_str("fraction_done_exact", true)?1:0;
49
+    $n = post_str("fraction_done_exact", true) ? 1 : 0;
50 50
     $app->update("fraction_done_exact=$n");
51 51
 
52 52
     echo "Application $id updated.
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 function add_app() {
59 59
     $name = BoincDb::escape_string(post_str('add_name'));
60 60
     $user_friendly_name = BoincDb::escape_string(post_str('add_user_friendly_name'));
61
-    if (empty($name) || empty($user_friendly_name) ) {
61
+    if (empty($name) || empty($user_friendly_name)) {
62 62
         admin_error_page(
63 63
             "To add a new application please supply both a brief name and a longer 'user-friendly' name.</font></p>"
64 64
         );
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
         <h2>Edit applications</h2>
82 82
     ";
83 83
 
84
-    $app_clause="deprecated=0";
85
-    $action_url="manage_apps.php";
86
-    if($all) {
84
+    $app_clause = "deprecated=0";
85
+    $action_url = "manage_apps.php";
86
+    if ($all) {
87 87
         $app_clause = "";
88
-        $action_url="manage_apps.php?all=1";
88
+        $action_url = "manage_apps.php?all=1";
89 89
         echo "<a href=\"manage_apps.php\">Don't show deprecated applications</a>";
90 90
     } else {
91 91
         echo "<a href=\"manage_apps.php?all=1\">Show deprecated applications</a>";
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
     $apps = BoincApp::enum($app_clause);
118 118
     foreach ($apps as $app) {
119 119
         // grey-out deprecated versions
120
-        $f1=$f2='';
121
-        if ($app->deprecated==1) {
120
+        $f1 = $f2 = '';
121
+        if ($app->deprecated == 1) {
122 122
             $f1 = "<font color='GREY'>";
123 123
             $f2 = "</font>";
124 124
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
         echo "  <TD align='left'>$f1<a href=app_details.php?appid=$app->id>$app->name</a><br> $app->user_friendly_name $f2</TD>\n";
130 130
 
131
-        echo "  <TD align='center'>$f1 " .date_str($app->create_time)."$f2</TD>\n";
131
+        echo "  <TD align='center'>$f1 ".date_str($app->create_time)."$f2</TD>\n";
132 132
 
133 133
         $v = $app->weight;
134 134
         echo "  <TD align='center'>
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         ";
152 152
 
153 153
         $v = '';
154
-        if ($app->homogeneous_app_version) $v=' CHECKED ';
154
+        if ($app->homogeneous_app_version) $v = ' CHECKED ';
155 155
         echo "  <TD align='center'>
156 156
             <input name='homogeneous_app_version' type='checkbox' $v></TD>
157 157
         ";
Please login to merge, or discard this patch.
html/ops/build_po.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 "X-Poedit-SourceCharset: utf-8\\n"
37 37
 
38 38
 
39
-HDR;
39
+hdr;
40 40
 
41 41
 $out = fopen("en.po", "w");
42 42
 
Please login to merge, or discard this patch.
html/user/forum_post.php 2 patches
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 $preview = post_str("preview", true);
54 54
 $warning = null;
55 55
 
56
-if ($content && $title && (!$preview)){
57
-    if (post_str('add_signature', true) == "add_it"){
56
+if ($content && $title && (!$preview)) {
57
+    if (post_str('add_signature', true) == "add_it") {
58 58
         $add_signature = true;    // set a flag and concatenate later
59
-    }  else {
59
+    } else {
60 60
         $add_signature = false;
61 61
     }
62 62
     check_tokens($logged_in_user->authenticator);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>";
112 112
 }
113 113
 
114
-if ($force_title && $title){
114
+if ($force_title && $title) {
115 115
     row2(tra("Title"), htmlspecialchars($title)."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($title)."\">");
116 116
 } else {
117 117
     row2(tra("Title").$submit_help,
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 $preview = post_str("preview", true);
54 54
 $warning = null;
55 55
 
56
-if ($content && $title && (!$preview)){
57
-    if (post_str('add_signature', true) == "add_it"){
58
-        $add_signature = true;    // set a flag and concatenate later
59
-    }  else {
56
+if ($content && $title && (!$preview)) {
57
+    if (post_str('add_signature', true) == "add_it") {
58
+        $add_signature = true; // set a flag and concatenate later
59
+    } else {
60 60
         $add_signature = false;
61 61
     }
62 62
     check_tokens($logged_in_user->authenticator);
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
             $title, $content, $logged_in_user, $forum, $add_signature, $export
69 69
         );
70 70
         if ($thread) {
71
-            header('Location: forum_thread.php?id=' . $thread->id);
71
+            header('Location: forum_thread.php?id='.$thread->id);
72 72
         } else {
73 73
             error_page("Can't create thread.  $forum_error");
74 74
         }
75 75
     }
76 76
 }
77 77
 
78
-page_head(tra("Create new thread"),'','','', $bbcode_js);
78
+page_head(tra("Create new thread"), '', '', '', $bbcode_js);
79 79
 show_forum_header($logged_in_user);
80 80
 
81 81
 if ($warning) {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>";
117 117
 }
118 118
 
119
-if ($force_title && $title){
119
+if ($force_title && $title) {
120 120
     row2(tra("Title"), htmlspecialchars($title)."<input type=\"hidden\" name=\"title\" value=\"".htmlspecialchars($title)."\">");
121 121
 } else {
122 122
     row2(tra("Title").$submit_help,
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
 echo "</td></tr>";
133 133
 
134 134
 if (!$logged_in_user->prefs->no_signature_by_default) {
135
-    $enable_signature="checked=\"true\"";
135
+    $enable_signature = "checked=\"true\"";
136 136
 } else {
137
-    $enable_signature="";
137
+    $enable_signature = "";
138 138
 }
139 139
 
140 140
 if (is_news_forum($forum)) {
@@ -150,5 +150,5 @@  discard block
 block discarded – undo
150 150
 
151 151
 page_tail();
152 152
 
153
-$cvs_version_tracker[]="\$Id$";
153
+$cvs_version_tracker[] = "\$Id$";
154 154
 ?>
Please login to merge, or discard this patch.
html/user/submit.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -369,7 +369,7 @@
 block discarded – undo
369 369
             $text = "---";
370 370
             if ($batch->state == BATCH_STATE_COMPLETE) {
371 371
                 $y = '<font color="red">failed</font>';
372
-            }   else {
372
+            } else {
373 373
                 $y = "in progress";
374 374
             }
375 375
         }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
     $wus = BoincWorkunit::enum("batch = $batch->id");
309 309
     $batch = get_batch_params($batch, $wus);
310 310
 
311
-    page_head("Batch $batch_id");
311
+    page_head("batch $batch_id");
312 312
     start_table();
313 313
     row2("name", $batch->name);
314 314
     row2("application", $app->name);
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
     $wu = BoincWorkunit::lookup_id($wuid);
394 394
     if (!$wu) error_page("no such job");
395 395
 
396
-    page_head("Job $wuid");
396
+    page_head("job $wuid");
397 397
 
398 398
     echo "
399 399
         <a href=workunit.php?wuid=$wuid>Workunit details</a> &middot;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -412,9 +412,9 @@  discard block
 block discarded – undo
412 412
         "Canonical instance<br><small>click to see result page on BOINC server</smallp>",
413 413
         "Download Results"
414 414
     );
415
-    foreach($wus as $wu) {
415
+    foreach ($wus as $wu) {
416 416
         $resultid = $wu->canonical_resultid;
417
-        $durl = boinc_get_wu_output_files_url($user,$wu->id);
417
+        $durl = boinc_get_wu_output_files_url($user, $wu->id);
418 418
         if ($resultid) {
419 419
             $x = "<a href=result.php?resultid=$resultid>$resultid</a>";
420 420
             $y = '<font color="green">completed</font>';
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
             $text = "---";
425 425
             if ($batch->state == BATCH_STATE_COMPLETE) {
426 426
                 $y = '<font color="red">failed</font>';
427
-            }   else {
427
+            } else {
428 428
                 $y = "in progress";
429 429
             }
430 430
         }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
     $results = BoincResult::enum("workunitid=$wuid");
490 490
     $upload_dir = parse_config(get_config(), "<upload_dir>");
491 491
     $fanout = parse_config(get_config(), "<uldl_dir_fanout>");
492
-    foreach($results as $result) {
492
+    foreach ($results as $result) {
493 493
         echo "<tr>
494 494
             <td><a href=result.php?resultid=$result->id>$result->id &middot; $result->name </a></td>
495 495
             <td>".state_string($result)."</td>
Please login to merge, or discard this patch.
html/user/bolt.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         $view = BoltView::lookup_id($e->last_view_id);
43 43
         $ago = time_diff(time() - $view->start_time);
44 44
         $pct = number_format($view->fraction_done*100, 0);
45
-        $status = "Started $start
45
+        $status = "started $start
46 46
             <br>Last visit: $ago ago
47 47
             <br>$pct% done
48 48
         ";
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     if ($course->hidden && !($user->bolt->flags&BOLT_FLAG_SHOW_ALL)) {
37 37
         continue;
38 38
     }
39
-    $e = $user?BoltEnrollment::lookup($user->id, $course->id):null;
39
+    $e = $user ?BoltEnrollment::lookup($user->id, $course->id) : null;
40 40
     if ($e) {
41 41
         $start = date_str($e->create_time);
42 42
         $view = BoltView::lookup_id($e->last_view_id);
Please login to merge, or discard this patch.
html/user/forum_reply.php 2 patches
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $parent_post_id = 0;
51 51
 }
52 52
 
53
-if ($filter != "false"){
53
+if ($filter != "false") {
54 54
     $filter = true;
55 55
 } else {
56 56
     $filter = false;
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
 }
66 66
 
67 67
 $warning = null;
68
-if ($content && (!$preview)){
69
-    if (post_str('add_signature',true)=="add_it"){
68
+if ($content && (!$preview)) {
69
+    if (post_str('add_signature',true)=="add_it") {
70 70
         $add_signature=true;    // set a flag and concatenate later
71
-    }  else {
71
+    } else {
72 72
         $add_signature=false;
73 73
     }
74 74
     check_tokens($logged_in_user->authenticator);
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $parent_post_id = 0;
51 51
 }
52 52
 
53
-if ($filter != "false"){
53
+if ($filter != "false") {
54 54
     $filter = true;
55 55
 } else {
56 56
     $filter = false;
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 }
66 66
 
67 67
 $warning = null;
68
-if ($content && (!$preview)){
69
-    if (post_str('add_signature',true)=="add_it"){
70
-        $add_signature=true;    // set a flag and concatenate later
71
-    }  else {
72
-        $add_signature=false;
68
+if ($content && (!$preview)) {
69
+    if (post_str('add_signature', true) == "add_it") {
70
+        $add_signature = true; // set a flag and concatenate later
71
+    } else {
72
+        $add_signature = false;
73 73
     }
74 74
     check_tokens($logged_in_user->authenticator);
75 75
     if (!akismet_check($logged_in_user, $content)) {
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     }
89 89
 }
90 90
 
91
-page_head(tra("Post to thread"),'','','', $bbcode_js);
91
+page_head(tra("Post to thread"), '', '', '', $bbcode_js);
92 92
 
93 93
 show_forum_header($logged_in_user);
94 94
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     $x1 = tra("Message:").bbcode_info().post_warning();
143 143
     $x2 = "";
144 144
     if ($parent_post) {
145
-        $x2 .=" ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>");
145
+        $x2 .= " ".tra("reply to %1 Message ID %2:", "<a href=#".$parent_post->id.">", " ".$parent_post->id."</a>");
146 146
     }
147 147
     $x2 .= "<form action=forum_reply.php?thread=".$thread->id;
148 148
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     $x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n";
154 154
     $x2 .= form_tokens($logged_in_user->authenticator);
155 155
     $x2 .= start_table_str().$bbcode_html.end_table_str()."<textarea class=\"form-control\" name=\"content\" rows=\"18\">";
156
-    $no_quote = get_int("no_quote", true)==1;
156
+    $no_quote = get_int("no_quote", true) == 1;
157 157
     if ($preview) {
158 158
         $x2 .= htmlspecialchars($content);
159 159
     } else if (!$no_quote) {
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
         }
163 163
     }
164 164
     if (!$logged_in_user->prefs->no_signature_by_default) {
165
-        $enable_signature="checked=\"true\"";
165
+        $enable_signature = "checked=\"true\"";
166 166
     } else {
167
-        $enable_signature="";
167
+        $enable_signature = "";
168 168
     }
169 169
     $x2 .= "</textarea><p> </p>
170 170
         <input class=\"btn btn-primary btn-sm \" type=\"submit\" name=\"preview\" value=\"".tra("Preview")."\">
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
 }
180 180
 
181 181
 function quote_text($text) {
182
-    $text = "[quote]" . $text . "[/quote]";
182
+    $text = "[quote]".$text."[/quote]";
183 183
     return $text;
184 184
 }
185 185
 
186
-$cvs_version_tracker[]="\$Id$";
186
+$cvs_version_tracker[] = "\$Id$";
187 187
 ?>
Please login to merge, or discard this patch.
html/user/submit_status.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     if (!$batch || $batch->user_id != $user->id) {
33 33
         error_page("no batch");
34 34
     }
35
-    page_head("Batch $batch->id");
35
+    page_head("batch $batch->id");
36 36
     $results = BoincResult::enum("batch=$batch->id order by workunitid");
37 37
     result_table_start(true, true, null);
38 38
     foreach ($results as $result) {
Please login to merge, or discard this patch.