plugins/shop/admin_modules/yf_manage_shop.class.php
yf_manage_shop
has 147 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class yf_manage_shop
{
/** @var bool Filter on/off */
public $USE_FILTER = true;
/** @var string Folder where product's images store */
File yf_manage_shop.class.php
has 704 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* Shop managing module.
*/
Method _init
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _init()
{
$supplier = db()->get('SELECT supplier_id, main_cat_id FROM ' . db('shop_admin_to_supplier') . ' WHERE admin_id=' . (int) (main()->ADMIN_ID));
if ($supplier['supplier_id']) {
$this->SUPPLIER_ID = $supplier['supplier_id'];
Function _init
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public function _init()
{
$supplier = db()->get('SELECT supplier_id, main_cat_id FROM ' . db('shop_admin_to_supplier') . ' WHERE admin_id=' . (int) (main()->ADMIN_ID));
if ($supplier['supplier_id']) {
$this->SUPPLIER_ID = $supplier['supplier_id'];
- Read upRead up
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"