GetList   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 31
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
A index() 0 6 1
A _sanitize() 0 3 1
1
<?php defined('BASEPATH') or exit('No direct script access allowed');
2
3
class GetList extends Auth_Controller {
4
	private $userID;
5
6
	public function __construct() {
7
		parent::__construct(FALSE);
8
9
		//CHECK: Should we limit internal AJAX requests?
10
		//$this->load->library('Limiter');
11
		//$this->load->library('form_validation');
12
13
		////1000 requests per hour to either AJAX request.
14
		//if($this->limiter->limit('tracker_general', 1000)) {
15
		//	$this->output->set_status_header('429', 'Rate limit reached'); //rate limited reached
16
17
		//	exit_ci();
18
		//}
19
20
		$this->userID = (int) $this->User->id;
21
	}
22
23
	public function index(string $category = 'all') : void {
24
		$data = $this->Tracker->list->get($this->userID, $category);
25
		$data = $this->_sanitize($data);
26
27
		$this->_render_json($data);
28
	}
29
30
	private function _sanitize(array $trackerData) : array {
31
		return $trackerData;
32
	}
33
}
34