File admin.php
has 402 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 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index() {
/** Callbacks Pagination */
if ($this->input->get('per_page')) {
$callbacksSession = [
'callback_url' => '?per_page=' . $this->input->get('per_page'),
- Create a ticketCreate a ticket
Function update
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function update($callbackId = null) {
$model = SCallbacksQuery::create()->setComment(__METHOD__)->findPk((int) $callbackId);
$paginationBrand = $this->session->userdata('callback_url');
$paginationBrand = $paginationBrand ?: null;
- 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 updateStatus
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function updateStatus($statusId = null, $locale = null) {
$locale = $locale ?: self::defaultLocale();
$model = SCallbackStatusesQuery::create()->setComment(__METHOD__)->findPk((int) $statusId);
- 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 createStatus
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function createStatus() {
$model = new SCallbackStatuses();
$locale = self::defaultLocale();
if ($this->input->post()) {
- 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 update
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update($callbackId = null) {
$model = SCallbacksQuery::create()->setComment(__METHOD__)->findPk((int) $callbackId);
$paginationBrand = $this->session->userdata('callback_url');
$paginationBrand = $paginationBrand ?: null;
- Create a ticketCreate a ticket
Function index
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function index() {
/** Callbacks Pagination */
if ($this->input->get('per_page')) {
$callbacksSession = [
'callback_url' => '?per_page=' . $this->input->get('per_page'),
- 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 updateTheme
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function updateTheme($themeId = null, $locale = null) {
$locale = $locale ?: self::defaultLocale();
$model = SCallbackThemesQuery::create()->setComment(__METHOD__)->findPk((int) $themeId);
- 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 updateStatus
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateStatus($statusId = null, $locale = null) {
$locale = $locale ?: self::defaultLocale();
$model = SCallbackStatusesQuery::create()->setComment(__METHOD__)->findPk((int) $statusId);
- Create a ticketCreate a ticket
Function createTheme
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function createTheme() {
$model = new SCallbackThemes;
if ($this->input->post()) {
$this->form_validation->set_rules($model->rules());
- 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 updateTheme
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateTheme($themeId = null, $locale = null) {
$locale = $locale ?: self::defaultLocale();
$model = SCallbackThemesQuery::create()->setComment(__METHOD__)->findPk((int) $themeId);
- Create a ticketCreate a ticket
Method initPagination
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function initPagination($totalCallbacks) {
$this->load->library('pagination');
$config['base_url'] = site_url('/admin/components/run/callbacks/index?') . http_build_query($this->input->get());
$config['container'] = 'shopAdminPage';
$config['uri_segment'] = 6;
- Create a ticketCreate a ticket
Method createStatus
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createStatus() {
$model = new SCallbackStatuses();
$locale = self::defaultLocale();
if ($this->input->post()) {
- Create a ticketCreate a ticket
Method createTheme
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createTheme() {
$model = new SCallbackThemes;
if ($this->input->post()) {
$this->form_validation->set_rules($model->rules());
- Create a ticketCreate a ticket
Function setDefaultStatus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function setDefaultStatus() {
if ($this->input->post('id') && is_numeric($this->input->post('id'))) {
$model = SCallbackStatusesQuery::create()->setComment(__METHOD__)->findPk($this->input->post('id'));
if ($model) {
if ($model->getIsDefault() == FALSE) {
- 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"