Completed
Push — master ( c044d5...f8791f )
by Angus
03:19
created

History   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A index() 0 15 3
1
<?php defined('BASEPATH') or exit('No direct script access allowed');
2
3
class History extends Auth_Controller {
4
	public function __construct() {
5
		parent::__construct();
6
	}
7
8
	public function index(int $page = 1) {
9
		if($page === 0) redirect('user/history/1');
10
11
		$this->header_data['title'] = "History";
12
		$this->header_data['page']  = "history";
13
14
		$historyData = $this->History->userGetHistory($page);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 20 spaces but found 1 space

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

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
15
		$this->body_data['historyData'] = $historyData['rows'];
16
		$this->body_data['currentPage'] = $page;
17
		$this->body_data['totalPages']  = $historyData['totalPages'];
18
19
		if($page > $this->body_data['totalPages']) redirect('user/history/1');
20
21
		$this->_render_page('User/History');
22
	}
23
}
24