plugins/shop/admin_modules/yf_manage_shop.class.php

Summary

Maintainability
F
4 days
Test Coverage

yf_manage_shop has 147 functions (exceeds 20 allowed). Consider refactoring.
Open

class yf_manage_shop
{
    /** @var bool Filter on/off */
    public $USE_FILTER = true;
    /** @var string Folder where product's images store */
Severity: Major
Found in plugins/shop/admin_modules/yf_manage_shop.class.php - About 2 days to fix

    File yf_manage_shop.class.php has 704 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * Shop managing module.
     */
    Severity: Major
    Found in plugins/shop/admin_modules/yf_manage_shop.class.php - About 1 day to fix

      Method _init has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      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'];
      Severity: Minor
      Found in plugins/shop/admin_modules/yf_manage_shop.class.php - About 1 hr to fix

        Function _init has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        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'];
        Severity: Minor
        Found in plugins/shop/admin_modules/yf_manage_shop.class.php - About 55 mins to fix

        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

        There are no issues that match your filters.

        Category
        Status