application/modules/gallery/models/gallery_m.php
Gallery_m
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Gallery_m extends CI_Model
{
public function Base() {
parent::__construct();
- Create a ticketCreate a ticket
File gallery_m.php
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
- Create a ticketCreate a ticket
Method get_albums
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function get_albums($order_by = 'date', $sort_order = 'desc', $category_id = 0) {
// Select albums
$locale = $this->chose_locale();
$this->joinI18n($this->db, 'gallery_albums', $locale);
- Create a ticketCreate a ticket
Method get_categories
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function get_categories($order_by = 'name', $sort_order = 'desc') {
if ($sort_order != 'desc' AND $sort_order != 'asc') {
$sort_order = 'desc';
}
- Create a ticketCreate a ticket
Function get_albums
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function get_albums($order_by = 'date', $sort_order = 'desc', $category_id = 0) {
// Select albums
$locale = $this->chose_locale();
$this->joinI18n($this->db, 'gallery_albums', $locale);
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_categories
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function get_categories($order_by = 'name', $sort_order = 'desc') {
if ($sort_order != 'desc' AND $sort_order != 'asc') {
$sort_order = 'desc';
}
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method get_album
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function get_album($id = 0, $include_images = TRUE, $limit, $page, $locale = null) {
- Create a ticketCreate a ticket