Permalink
Browse files

code cleanup based on analysis by [Scrutinizer](https://scrutinizer-c…

  • Loading branch information...
malle-pietje committed Nov 20, 2018
1 parent 0a47418 commit 5ab47d85236cb550ce812e2b5ef060db41a929df
Showing with 10 additions and 8 deletions.
  1. +3 −1 TODO.md
  2. +7 −7 index.php
@@ -4,12 +4,14 @@
- ~~print_r ($data);~~
- ~~echo json_encode($data, JSON_PRETTY_PRINT);~~
- DataTables for table output and more
- requires "flattening" of multidimensional arrays/objects
- or else only expose a selection of attributes
- Chart output as option for certain data collections (and selected attributes)

2. Add the option to export data to CSV file format
- need to have the option to select which fields to export
- could be combined with the DataTables output option
- will require "flattening" of multidimensional arrays/objects
- requires "flattening" of multidimensional arrays/objects

3. ~~Add simple user/password login~~
- ~~consider setting user name/password in the config file, though not very secure~~
@@ -192,15 +192,15 @@
* load login form data, if present, and save to credential variables
*/
if (isset($_POST['controller_user']) && !empty($_POST['controller_user'])) {
$controller['user'] = $_POST['controller_user'];
$controller['user'] = $_POST['controller_user'];
}
if (isset($_POST['controller_password']) && !empty($_POST['controller_password'])) {
$controller['password'] = $_POST['controller_password'];
}
if (isset($_POST['controller_url']) && !empty($_POST['controller_url'])) {
$controller['url'] = $_POST['controller_url'];
$controller['url'] = $_POST['controller_url'];
}
if (isset($controller)) {
@@ -614,9 +614,9 @@
*/
$time_end = microtime(true);
$time_total = $time_end - $time_start;
$login_perc = ($time_after_login/$time_total)*100;
$load_perc = (($time_after_load - $time_after_login)/$time_total)*100;
$remain_perc = 100 - $login_perc-$load_perc;
$login_perc = ($time_after_login / $time_total) * 100;
$load_perc = (($time_after_load - $time_after_login) / $time_total) * 100;
$remain_perc = 100 - $login_perc - $load_perc;
/**
* shared functions
@@ -794,7 +794,7 @@ function get_client_version()
<?php } ?>
<!-- /controllers dropdown -->
<!-- sites dropdown, only show when a controller has been selected -->
<?php if ($show_login == false && isset($controller['name'])) { ?>
<?php if ($show_login === false && isset($controller['name'])) { ?>
<li id="site-menu" class="dropdown">
<a id="site-menu" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">

@@ -1218,7 +1218,7 @@ function get_client_version()
timing_total_time = '<?php echo $time_total ?>',
php_version = '<?php echo (phpversion()) ?>',
memory_limit = '<?php echo (ini_get('memory_limit')) ?>',
memory_used = '<?php echo round(memory_get_peak_usage(false)/1024/1024, 2) . 'M' ?>',
memory_used = '<?php echo round(memory_get_peak_usage(false) / 1024 / 1024, 2) . 'M' ?>',
curl_version = '<?php echo $curl_version ?>',
openssl_version = '<?php echo $openssl_version ?>',
os_version = '<?php echo (php_uname('s') . ' ' . php_uname('r')) ?>',

0 comments on commit 5ab47d8

Please sign in to comment.