for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php defined('BASEPATH') or exit('No direct script access allowed');
class History extends Auth_Controller {
public function __construct() {
parent::__construct();
}
public function index(int $page = 1) {
if($page === 0) redirect('user/history/1');
$this->header_data['title'] = "History";
$this->header_data['page'] = "history";
$historyData = $this->History->userGetHistory($page);
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
$this->body_data['historyData'] = $historyData['rows'];
$this->body_data['currentPage'] = $page;
$this->body_data['totalPages'] = $historyData['totalPages'];
if($page > $this->body_data['totalPages']) redirect('user/history/1');
$this->_render_page('User/History');
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.