Completed
Push — master ( 45893c...373238 )
by Angus
02:39
created

Tracker_Model::favouriteChapter()   C

Complexity

Conditions 9
Paths 9

Size

Total Lines 75
Code Lines 47

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 90

Importance

Changes 0
Metric Value
cc 9
eloc 47
nc 9
nop 4
dl 0
loc 75
ccs 0
cts 0
cp 0
crap 90
rs 5.875
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
2
3
include_once APPPATH.'models/Tracker/Tracker_Base_Model.php';
4
foreach (glob(APPPATH.'models/Tracker/*.php') as $filename) {
5
	/** @noinspection PhpIncludeInspection */
6
	include_once $filename;
7
}
8
class Tracker_Model extends Tracker_Base_Model {
9
	public $title;
10
	public $list;
11
	public $tag;
12
	public $favourites;
13
	public $category;
14
	public $portation;
15
	public $admin;
16
	public $stats;
17
	public $bug;
18
19 112
	public function __construct() {
20 112
		parent::__construct();
21
22
		//Modules
23 112
		$this->title      = new Tracker_Title_Model();
24 112
		$this->list       = new Tracker_List_Model();
25 112
		$this->favourites = new Tracker_Favourites_Model();
26 112
		$this->tag        = new Tracker_Tag_Model();
27 112
		$this->category   = new Tracker_Category_Model();
28 112
		$this->portation  = new Tracker_Portation_Model();
29 112
		$this->admin      = new Tracker_Admin_Model();
30 112
		$this->stats      = new Tracker_Stats_Model();
31 112
		$this->bug        = new Tracker_Bug_Model();
32 112
	}
33
}
34