File admin.php
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
(defined('BASEPATH')) OR exit('No direct script access allowed');
use CMSFactory\assetManager;
- Create a ticketCreate a ticket
Method index
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index() {
if ($this->input->post()) {
try {
switch ($this->input->post('action')) {
// Upload template from pc or url
- Create a ticketCreate a ticket
Function deleteTemplate
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function deleteTemplate($templateName) {
// Template directory path
$dir = TEMPLATES_PATH . $templateName;
$delete = TRUE;
- 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 index
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function index() {
if ($this->input->post()) {
try {
switch ($this->input->post('action')) {
// Upload template from pc or url
- 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 deleteTemplate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteTemplate($templateName) {
// Template directory path
$dir = TEMPLATES_PATH . $templateName;
$delete = TRUE;
- Create a ticketCreate a ticket
Function setLogoFav
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function setLogoFav() {
$this->load->library('SiteInfo');
$imagesPath = PUBPATH . $this->siteinfo->imagesPath;
- 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 setLogoFav
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setLogoFav() {
$this->load->library('SiteInfo');
$imagesPath = PUBPATH . $this->siteinfo->imagesPath;
- Create a ticketCreate a ticket
Function uploadByUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function uploadByUrl($url, $content = '') {
if (!$content) {
$ext = pathinfo($url, PATHINFO_EXTENSION);
if ($ext != 'zip') {
throw new Exception(lang('Wrong file type', 'template_manager'));
- 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 getRemoteTemplate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getRemoteTemplate($templateId = NULL) {
if ($templateId) {
$template_content = file_get_contents(self::REMOTE_TEMPLATES_REPOSITORY . $templateId);
if ($template_content) {
- 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"