New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static code analyzer WIP results #228

Closed
wants to merge 40 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@Exileum
Member

Exileum commented May 4, 2017

Тестовый прогон статическим анализатором кода - исключительно автоматические правки.

Exileum added some commits May 4, 2017

Exileum added some commits May 4, 2017

@Exileum Exileum added this to the Версия 2.1.6 milestone May 4, 2017

@Exileum Exileum self-assigned this May 4, 2017

@Exileum Exileum requested a review from VasyOk May 4, 2017

@@ -500,7 +500,7 @@ function make_url($path = '')
bb_log(date('H:i:s - ') . getmypid() . ' --x- DB-LOCK OBTAINED !!!!!!!!!!!!!!!!!' . LOG_LF, CRON_LOG_DIR . '/cron_check');
sleep(2);
require(CRON_DIR . 'cron_init.php');
require CRON_DIR . 'cron_init.php';

This comment has been minimized.

@@ -390,7 +392,7 @@ public function handle_attachments($mode)
} else {
$sql = 'UPDATE ' . BB_ATTACHMENTS_DESC . ' SET thumbnail = 0 WHERE attach_id = ' . (int) $actual_id_list[$i];
if (!(DB()->sql_query($sql))) {
if (!DB()->sql_query($sql)) {
bb_die('Unable to update ' . BB_ATTACHMENTS_DESC);
}
}

This comment has been minimized.

@@ -390,7 +392,7 @@ public function handle_attachments($mode)
} else {
$sql = 'UPDATE ' . BB_ATTACHMENTS_DESC . ' SET thumbnail = 0 WHERE attach_id = ' . (int) $actual_id_list[$i];
if (!(DB()->sql_query($sql))) {
if (!DB()->sql_query($sql)) {
bb_die('Unable to update ' . BB_ATTACHMENTS_DESC);
}
}
@@ -390,7 +392,7 @@ public function handle_attachments($mode)
} else {
$sql = 'UPDATE ' . BB_ATTACHMENTS_DESC . ' SET thumbnail = 0 WHERE attach_id = ' . (int) $actual_id_list[$i];
if (!(DB()->sql_query($sql))) {
if (!DB()->sql_query($sql)) {
bb_die('Unable to update ' . BB_ATTACHMENTS_DESC);
}
}
@@ -390,7 +392,7 @@ public function handle_attachments($mode)
} else {
$sql = 'UPDATE ' . BB_ATTACHMENTS_DESC . ' SET thumbnail = 0 WHERE attach_id = ' . (int) $actual_id_list[$i];
if (!(DB()->sql_query($sql))) {
if (!DB()->sql_query($sql)) {
bb_die('Unable to update ' . BB_ATTACHMENTS_DESC);
}
}
{
global $userdata, $post_info, $is_auth, $bb_cfg, $lang, $datastore;
$current_time = TIMENOW;
// Flood control
$row = null;
$where_sql = (IS_GUEST) ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}";
$where_sql = IS_GUEST ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}";
{
global $userdata, $post_info, $is_auth, $bb_cfg, $lang, $datastore;
$current_time = TIMENOW;
// Flood control
$row = null;
$where_sql = (IS_GUEST) ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}";
$where_sql = IS_GUEST ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}";
{
global $userdata, $post_info, $is_auth, $bb_cfg, $lang, $datastore;
$current_time = TIMENOW;
// Flood control
$row = null;
$where_sql = (IS_GUEST) ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}";
$where_sql = IS_GUEST ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}";

This comment has been minimized.

{
global $userdata, $post_info, $is_auth, $bb_cfg, $lang, $datastore;
$current_time = TIMENOW;
// Flood control
$row = null;
$where_sql = (IS_GUEST) ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}";
$where_sql = IS_GUEST ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}";
{
global $userdata, $post_info, $is_auth, $bb_cfg, $lang, $datastore;
$current_time = TIMENOW;
// Flood control
$row = null;
$where_sql = (IS_GUEST) ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}";
$where_sql = IS_GUEST ? "p.poster_ip = '" . USER_IP . "'" : "p.poster_id = {$userdata['user_id']}";
@@ -512,20 +547,23 @@ public function generate_block_varref($namespace, $varname)
*
* If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
* NOTE: does not expect a trailing "." on the blockname.
@@ -376,8 +396,11 @@ public function precompile($template, $filename)
* template.
* Note that all desired assignments to the variables in $handle should be done
* BEFORE calling this function.
* @param $varname
@@ -512,20 +547,23 @@ public function generate_block_varref($namespace, $varname)
*
* If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
* NOTE: does not expect a trailing "." on the blockname.
$attach_id_array = explode(', ', $attach_id_array);
} elseif (strstr($attach_id_array, ',')) {
$attach_id_array = explode(',', $attach_id_array);
} else {
$attach_id = intval($attach_id_array);
$attach_id_array = explode(', ', $attach_id_array);
} elseif (strstr($attach_id_array, ',')) {
$attach_id_array = explode(',', $attach_id_array);
} else {
$attach_id = intval($attach_id_array);
$attach_id_array = explode(', ', $attach_id_array);
} elseif (strstr($attach_id_array, ',')) {
$attach_id_array = explode(',', $attach_id_array);
} else {
$attach_id = intval($attach_id_array);
@Exileum

This comment has been minimized.

Show comment
Hide comment
@Exileum

Exileum May 9, 2017

Member

Cherry picked to #229.

Member

Exileum commented May 9, 2017

Cherry picked to #229.

@Exileum Exileum closed this May 9, 2017

@Exileum Exileum deleted the Exileum:feature/code_inspect branch May 9, 2017

Exileum added a commit that referenced this pull request May 9, 2017

Merge pull request #229 from diolektor/enhancement-code
Static code analyzer cherry picked from #228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment