Passed
Pull Request — master (#6531)
by Vitalii
19:53 queued 10:25
created
html/user/json_form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 require_once('../inc/util.inc');
6 6
 require_once('../inc/sandbox.inc');
7 7
 
8
-function sb_file_select($user, $suffix=null) {
8
+function sb_file_select($user, $suffix = null) {
9 9
     $sbfiles = sandbox_file_names($user);
10 10
     $sbitems = [];
11 11
     $exp = null;
Please login to merge, or discard this patch.
html/user/weak_auth.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 $master_url = master_url();
31 31
 $idx = strpos($master_url, '://');
32 32
 if ($idx) {
33
-    $url = substr($master_url, $idx+strlen('://'));
33
+    $url = substr($master_url, $idx + strlen('://'));
34 34
 } else {
35 35
     $url = $master_url;
36 36
 }
37 37
 
38 38
 // convert invalid characters into underscores
39 39
 //
40
-for ($i=0; $i<strlen($url); $i++) {
40
+for ($i = 0; $i < strlen($url); $i++) {
41 41
     $c = $url[$i];
42 42
     if (!ctype_alnum($c) && $c != '.' && $c != '-' && $c != '_') {
43 43
         $url[$i] = '_';
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
 //remove trailing underscore(s)
48 48
 //
49
-$account_file = "account_" . rtrim($url, '_') . ".xml";
49
+$account_file = "account_".rtrim($url, '_').".xml";
50 50
 
51 51
 page_head(tra("Account keys"));
52 52
 text_start();
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
     <p>",
59 59
     tra("This key can be used to:"),
60 60
     "<ul>
61
-    <li><a href=get_passwd.php>",tra("log in to your account on the web"),"</a>;
61
+    <li><a href=get_passwd.php>",tra("log in to your account on the web"), "</a>;
62 62
     <li>",
63 63
         tra("attach a computer to your account without using the BOINC Manager.
64 64
        To do so, install BOINC,
65 65
        create a file named %1 in the BOINC
66
-       data directory, and set its contents to:","<b>$account_file</b>"),"
66
+       data directory, and set its contents to:","<b>$account_file</b>"), "
67 67
     <p><pre>",
68 68
     htmlspecialchars(
69 69
 "<account>
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
     as described above, but cannot be used to log in to your account or change it in any way.
78 78
     If you want to attach untrusted or insecure computers to your account,
79 79
     do so using your weak account key.
80
-    Your weak account key is:"),"
80
+    Your weak account key is:"), "
81 81
     <p><pre>$weak_auth</pre><p>
82 82
     ",
83
-    tra("The key depends on your account's email address and password.  If you change either of these, the weak account key will change."),"
83
+    tra("The key depends on your account's email address and password.  If you change either of these, the weak account key will change."), "
84 84
     </td></tr></table>"
85 85
 ;
86 86
 text_end();
Please login to merge, or discard this patch.
html/user/submit_stats.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -199,25 +199,25 @@  discard block
 block discarded – undo
199 199
     $min = 1e99;
200 200
     $max = 0;
201 201
     foreach ($results as $r) {
202
-        $f = $r->flops / (4.3e9 *3600);
202
+        $f = $r->flops/(4.3e9*3600);
203 203
         if ($f > $max) $max = $f;
204 204
         if ($f < $min) $min = $f;
205 205
         $x[] = $f;
206 206
     }
207 207
     $n = 800;
208 208
     $count = [];
209
-    for ($i=0; $i<$n; $i++) {
209
+    for ($i = 0; $i < $n; $i++) {
210 210
         $count[$i] = 0;
211 211
     }
212 212
     $range = $max - $min;
213 213
     foreach ($x as $f) {
214
-        $d = intval($n*($f-$min)/$range);
215
-        if ($d >= $n) $d = $n-1;
214
+        $d = intval($n*($f - $min)/$range);
215
+        if ($d >= $n) $d = $n - 1;
216 216
         $count[$d] += 1;
217 217
     }
218 218
     $data = [];
219
-    for ($i=0; $i<$n; $i++) {
220
-        $data[] = [$min+($i*$range)/$n, $count[$i]];
219
+    for ($i = 0; $i < $n; $i++) {
220
+        $data[] = [$min + ($i*$range)/$n, $count[$i]];
221 221
     }
222 222
     graph($data, 'hours', 'count');
223 223
     page_tail();
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
 $batch = BoincBatch::lookup_id(get_int('batch_id'));
227 227
 if (!$batch) error_page('no batch');
228
-switch(get_str('action')) {
228
+switch (get_str('action')) {
229 229
 case 'err_host':
230 230
     err_host($batch);
231 231
     break;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 }
193 193
 
194 194
 function flops_graph($batch) {
195
-    page_head("Batch $batch->id job runtimes");
195
+    page_head("batch $batch->id job runtimes");
196 196
     echo "
197 197
     <p>
198 198
     Runtimes of completed jobs, normalized to an average (4.3 GFLOPS) computer.
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         }
252 252
     }
253 253
     arsort($x);
254
-    page_head("Batch $batch->id: completed jobs grouped by host");
254
+    page_head("batch $batch->id: completed jobs grouped by host");
255 255
     text_start();
256 256
     start_table();
257 257
     table_header('Host', 'OS', '# jobs');
Please login to merge, or discard this patch.
html/user/download_software.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 //
55 55
 function get_platform($user_agent) {
56 56
     if (strstr($user_agent, 'Windows')) {
57
-        if (strstr($user_agent, 'Win64')||strstr($user_agent, 'WOW64')) {
57
+        if (strstr($user_agent, 'Win64') || strstr($user_agent, 'WOW64')) {
58 58
             return 'windows_x86_64';
59 59
         } else {
60 60
             return 'windows_intelx86';
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
     handle_get_info();
345 345
 } else {
346 346
     $dev = get_str("dev", true);
347
-    $user_agent = get_str("user_agent", true);      // for debugging
347
+    $user_agent = get_str("user_agent", true); // for debugging
348 348
     if (!$user_agent) {
349 349
         $user_agent = $_SERVER['HTTP_USER_AGENT'];
350 350
     }
Please login to merge, or discard this patch.
html/inc/keywords.inc 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -24,77 +24,77 @@  discard block
 block discarded – undo
24 24
 define('KW_CATEGORY_SCIENCE', 0);
25 25
 define('KW_CATEGORY_LOC', 1);
26 26
 
27
-define('KW_ASTRONOMY',      1);
28
-define('KW_SETI',           2);
29
-define('KW_PULSARS',        3);
30
-define('KW_GW',             4);
31
-define('KW_COSMOLOGY',      5);
32
-define('KW_PHYSICS',        6);
27
+define('KW_ASTRONOMY', 1);
28
+define('KW_SETI', 2);
29
+define('KW_PULSARS', 3);
30
+define('KW_GW', 4);
31
+define('KW_COSMOLOGY', 5);
32
+define('KW_PHYSICS', 6);
33 33
 define('KW_PARTICLE_PHYSICS', 7);
34
-define('KW_NANOSCIENCE',    8);
35
-define('KW_BIOMED',         9);
34
+define('KW_NANOSCIENCE', 8);
35
+define('KW_BIOMED', 9);
36 36
 define('KW_DRUG_DISCOVERY', 10);
37
-define('KW_PROTEINS',       11);
38
-define('KW_GENETICS',       12);
39
-define('KW_DISEASE',        13);
40
-define('KW_CANCER',         14);
41
-define('KW_MATH_CS',        15);
42
-define('KW_AI',             16);
43
-define('KW_OCEANIA',        17);
44
-define('KW_AUSTRALIA',      18);
37
+define('KW_PROTEINS', 11);
38
+define('KW_GENETICS', 12);
39
+define('KW_DISEASE', 13);
40
+define('KW_CANCER', 14);
41
+define('KW_MATH_CS', 15);
42
+define('KW_AI', 16);
43
+define('KW_OCEANIA', 17);
44
+define('KW_AUSTRALIA', 18);
45 45
 
46
-define('KW_EUROPE',         20);
47
-define('KW_GERMANY',        21);
48
-define('KW_ASIA',           22);
49
-define('KW_AMERICAS',       23);
50
-define('KW_US',             24);
51
-define('KW_UCB',            25);
52
-define('KW_AEI',            26);
53
-define('KW_CERN',           27);
54
-define('KW_UW',             28);
55
-define('KW_EARTH_SCI',      29);
56
-define('KW_SPAIN',          30);
57
-define('KW_SAN_JORGE',      31);
58
-define('KW_NUMBER_THEORY',  32);
59
-define('KW_CRYPTO',         33);
60
-define('KW_ENV_RESEARCH',   34);
61
-define('KW_CLIMATE',        35);
62
-define('KW_CZECH',          36);
46
+define('KW_EUROPE', 20);
47
+define('KW_GERMANY', 21);
48
+define('KW_ASIA', 22);
49
+define('KW_AMERICAS', 23);
50
+define('KW_US', 24);
51
+define('KW_UCB', 25);
52
+define('KW_AEI', 26);
53
+define('KW_CERN', 27);
54
+define('KW_UW', 28);
55
+define('KW_EARTH_SCI', 29);
56
+define('KW_SPAIN', 30);
57
+define('KW_SAN_JORGE', 31);
58
+define('KW_NUMBER_THEORY', 32);
59
+define('KW_CRYPTO', 33);
60
+define('KW_ENV_RESEARCH', 34);
61
+define('KW_CLIMATE', 35);
62
+define('KW_CZECH', 36);
63 63
 define('KW_CHARLES_PRAGUE', 37);
64
-define('KW_RECHENKRAFT',    38);
65
-define('KW_RHEINMAIN',      39);
66
-define('KW_HUNGARY',        40);
67
-define('KW_IRELAND',        41);
68
-define('KW_UC_DUBLIN',      42);
69
-define('KW_POLAND',         43);
70
-define('KW_RUSSIA',         44);
64
+define('KW_RECHENKRAFT', 38);
65
+define('KW_RHEINMAIN', 39);
66
+define('KW_HUNGARY', 40);
67
+define('KW_IRELAND', 41);
68
+define('KW_UC_DUBLIN', 42);
69
+define('KW_POLAND', 43);
70
+define('KW_RUSSIA', 44);
71 71
 define('KW_SW_STATE_RUSSIA', 45);
72
-define('KW_RAS',            46);
73
-define('KW_PRBB',           47);
74
-define('KW_UK',             48);
75
-define('KW_OXFORD',         49);
76
-define('KW_CHINA',          50);
77
-define('KW_U_DAYTON',       51);
78
-define('KW_WRIGHT_STATE',   52);
79
-define('KW_USC',            53);
80
-define('KW_FULLERTON',      54);
81
-define('KW_ARIZONA_STATE',  55);
82
-define('KW_U_ILLINOIS',     56);
83
-define('KW_U_WARSAW',       57);
84
-define('KW_RPI',            58);
85
-define('KW_INTERNATIONAL',  59);
86
-define('KW_UND',            60);
87
-define('KW_HOLLAND',        61);
88
-define('KW_CHEMISTRY',      62);
89
-define('KW_GAMES',          63);
90
-define('KW_VIRUS',          64);
91
-define('KW_FRANCE',         65);
92
-define('KW_CANADA',         66);
93
-define('KW_PSU',            67);
94
-define('KW_SU',             68);
95
-define('KW_SINAI_U',        69);
96
-define('KW_AFRICA',         70);
97
-define('KW_EGYPT',          71);
72
+define('KW_RAS', 46);
73
+define('KW_PRBB', 47);
74
+define('KW_UK', 48);
75
+define('KW_OXFORD', 49);
76
+define('KW_CHINA', 50);
77
+define('KW_U_DAYTON', 51);
78
+define('KW_WRIGHT_STATE', 52);
79
+define('KW_USC', 53);
80
+define('KW_FULLERTON', 54);
81
+define('KW_ARIZONA_STATE', 55);
82
+define('KW_U_ILLINOIS', 56);
83
+define('KW_U_WARSAW', 57);
84
+define('KW_RPI', 58);
85
+define('KW_INTERNATIONAL', 59);
86
+define('KW_UND', 60);
87
+define('KW_HOLLAND', 61);
88
+define('KW_CHEMISTRY', 62);
89
+define('KW_GAMES', 63);
90
+define('KW_VIRUS', 64);
91
+define('KW_FRANCE', 65);
92
+define('KW_CANADA', 66);
93
+define('KW_PSU', 67);
94
+define('KW_SU', 68);
95
+define('KW_SINAI_U', 69);
96
+define('KW_AFRICA', 70);
97
+define('KW_EGYPT', 71);
98 98
 
99 99
 $job_keywords = array();
100 100
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
     }
353 353
 }
354 354
 
355
-function kw_options($id, $indent='') {
355
+function kw_options($id, $indent = '') {
356 356
     global $job_keywords;
357 357
     $kw = $job_keywords[$id];
358 358
     $opts = [[$id, "$indent$kw->name"]];
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
     return $kw->name;
370 370
 }
371 371
 
372
-function kw_array_to_str($kws, $sep='<br>') {
372
+function kw_array_to_str($kws, $sep = '<br>') {
373 373
     $x = array_map('strval', $kws);
374 374
     $x = array_map('kw_id_to_name', $x);
375 375
     return implode($sep, $x);
Please login to merge, or discard this patch.
html/user/buda_submit.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 //
86 86
 function unzip_batch_file($user, $batch_file) {
87 87
     @mkdir("../../buda_batches");
88
-    for ($i=0; $i<1000; $i++) {
88
+    for ($i = 0; $i < 1000; $i++) {
89 89
         $batch_dir = "../../buda_batches/$i";
90 90
         $batch_dir_name = $i;
91 91
         $ret = @mkdir($batch_dir);
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         }
137 137
         $job_files = [];
138 138
         $cmdline = '';
139
-        foreach(scandir("$batch_dir/$fname") as $f2) {
139
+        foreach (scandir("$batch_dir/$fname") as $f2) {
140 140
             if ($f2[0] == '.') continue;
141 141
             if ($f2 == 'cmdline') {
142 142
                 $cmdline = trim(file_get_contents("$batch_dir/$fname/cmdline"));
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 function stage_input_files($batch_dir, $batch_desc, $batch_id) {
191 191
     $n = count($batch_desc->shared_files);
192 192
     $batch_desc->shared_files_phys_names = [];
193
-    for ($i=0; $i<$n; $i++) {
193
+    for ($i = 0; $i < $n; $i++) {
194 194
         $path = sprintf('%s/%s', $batch_dir, $batch_desc->shared_files[$i]);
195 195
         [$md5, $size] = $batch_desc->shared_file_infos[$i];
196 196
         $phys_name = sprintf('batch_%d_%s', $batch_id, $md5);
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     foreach ($batch_desc->jobs as $job) {
201 201
         $n = count($batch_desc->unshared_files);
202 202
         $job->phys_names = [];
203
-        for ($i=0; $i<$n; $i++) {
203
+        for ($i = 0; $i < $n; $i++) {
204 204
             $path = sprintf('%s/%s/%s',
205 205
                 $batch_dir, $job->dir, $batch_desc->unshared_files[$i]
206 206
             );
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     }
250 250
     $wrapper_cmdline = sprintf('"--dockerfile %s %s %s"',
251 251
         $variant_desc->dockerfile,
252
-        $wrapper_verbose?'--verbose':'',
252
+        $wrapper_verbose ? '--verbose' : '',
253 253
         $cmdline
254 254
     );
255 255
     $cmd = sprintf(
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     $max_runtime_days = (double)$max_runtime_days;
299 299
     if ($max_runtime_days <= 0) error_page('bad runtime limit');
300 300
     if ($max_runtime_days > 100) error_page('bad runtime limit');
301
-    $max_fpops = $max_runtime_days * 4.3e9 * 86400;
301
+    $max_fpops = $max_runtime_days*4.3e9*86400;
302 302
 
303 303
     $exp_runtime_days = get_str('exp_runtime_days');
304 304
     if (!is_numeric($exp_runtime_days)) error_page('bad expected runtime');
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
     if ($exp_runtime_days > $max_runtime_days) {
309 309
         error_page('exp must be < max runtime');
310 310
     }
311
-    $exp_fpops = $exp_runtime_days * 4.3e9 * 86400;
311
+    $exp_fpops = $exp_runtime_days*4.3e9*86400;
312 312
 
313 313
     $app_desc = get_buda_desc($app);
314 314
 
@@ -361,9 +361,9 @@  discard block
 block discarded – undo
361 361
 
362 362
     // clean up batch dir
363 363
     //
364
-    //system("rm -rf $batch_dir");
364
+    //system("rm - rf $batch_dir");
365 365
 
366
-    header("Location: submit.php?action=query_batch&batch_id=$batch->id");
366
+    header("Location: submit.php ?action=query_batch&batch_id = $batch->id");
367 367
 }
368 368
 
369 369
 function show_list() {
@@ -374,20 +374,20 @@  discard block
 block discarded – undo
374 374
         $desc = get_buda_desc($app);
375 375
         $vars = get_buda_variants($app);
376 376
         echo "$desc->long_name
377
-            <ul>
377
+            <ul >
378 378
         ";
379 379
         foreach ($vars as $var) {
380 380
             echo sprintf('<li><a href=buda_submit.php?action=form&app=%s&variant=%s>%s</a>',
381 381
                 $app, $var, $var
382 382
             );
383 383
         }
384
-        echo "</ul>\n";
384
+        echo " < /ul > \n";
385 385
     }
386 386
     page_tail();
387 387
 }
388 388
 
389 389
 $user = get_logged_in_user();
390
-$buda_boinc_app = BoincApp::lookup("name='buda'");
390
+$buda_boinc_app = BoincApp::lookup("name = 'buda'");
391 391
 if (!$buda_boinc_app) error_page('no buda app');
392 392
 if (!has_submit_access($user, $buda_boinc_app->id)) {
393 393
     error_page('no access');
Please login to merge, or discard this patch.