Showing 65 of 1,795 total issues

Method init has 161 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function init()
    {
        $this->_a['table'] = 'shop_order';
        $this->_a['verbose'] = 'Shop_Order';
        $this->_a['cols'] = array(
Severity: Major
Found in src/Shop/Order.php - About 6 hrs to fix

    File DigiDoki.php has 422 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    use Pluf\Workflow;
    
    /**
     * DigiDoki Order manager
    Severity: Minor
    Found in src/Shop/Order/Manager/DigiDoki.php - About 6 hrs to fix

      Method init has 98 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function init()
          {
              $this->_a['table'] = 'shop_orderhistory';
              $this->_a['verbose'] = 'Shop Order History';
              $this->_a['cols'] = array(
      Severity: Major
      Found in src/Shop/OrderHistory.php - About 3 hrs to fix

        Function get has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function get($request, $match)
            {
                // Check if product exsit
                $item = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['modelId']);
                // Extract metafield id or metafield key if id is not provided
        Severity: Minor
        Found in src/Shop/Views/ProductMetafield.php - About 3 hrs 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

        Function get has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function get($request, $match)
            {
                // Check if service exsit
                $item = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['modelId']);
                // Extract metafield id or metafield key if id is not provided
        Severity: Minor
        Found in src/Shop/Views/ServiceMetafield.php - About 3 hrs 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

        File Event.php has 291 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        class Shop_Order_Event
        {
        
        
        Severity: Minor
        Found in src/Shop/Order/Event.php - About 3 hrs to fix

          File DigiDoki.php has 288 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          class Shop_Order_Event_DigiDoki extends Shop_Order_Event
          {
          
          
          Severity: Minor
          Found in src/Shop/Order/Event/DigiDoki.php - About 2 hrs to fix

            Method init has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function init()
                {
                    $this->_a['table'] = 'shop_order_item';
                    $this->_a['verbose'] = 'Shop_OrderItem';
                    $this->_a['cols'] = array(
            Severity: Major
            Found in src/Shop/OrderItem.php - About 2 hrs to fix

              Method init has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function init()
                  {
                      parent::init();
                      $this->_model = 'Shop_Zone';
                      $this->_a['table'] = 'shop_zone';
              Severity: Major
              Found in src/Shop/Zone.php - About 2 hrs to fix

                Method init has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function init()
                    {
                        $this->_a['table'] = 'shop_category';
                        $this->_a['verbose'] = 'Shop Category';
                        $this->_a['cols'] = array(
                Severity: Major
                Found in src/Shop/Category.php - About 2 hrs to fix

                  Method init has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function init()
                      {
                          parent::init();
                          $this->_a['table'] = 'shop_agency';
                          $this->_a['model'] = 'Shop_Agency';
                  Severity: Major
                  Found in src/Shop/Agency.php - About 2 hrs to fix

                    Method init has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function init()
                        {
                            $this->_a['table'] = 'shop_order_attachments';
                            $this->_a['cols'] = array(
                                // شناسه‌ها
                    Severity: Major
                    Found in src/Shop/OrderAttachment.php - About 2 hrs to fix

                      Method init has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function init()
                          {
                              $this->_a['table'] = 'shop_service_metafield';
                              $this->_a['verbose'] = 'Shop_ServiceMetafield';
                              $this->_a['cols'] = array(
                      Severity: Major
                      Found in src/Shop/ServiceMetafield.php - About 2 hrs to fix

                        Method init has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function init()
                            {
                                $this->_a['table'] = 'shop_product_metafield';
                                $this->_a['verbose'] = 'Shop_ProductMetafield';
                                $this->_a['cols'] = array(
                        Severity: Major
                        Found in src/Shop/ProductMetafield.php - About 2 hrs to fix

                          Method init has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function init()
                              {
                                  $this->_a['table'] = 'shop_address';
                                  $this->_a['verbose'] = 'Shop_Address';
                                  $this->_model = 'Shop_Address';
                          Severity: Major
                          Found in src/Shop/Address.php - About 2 hrs to fix

                            Method transferCommission has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function transferCommission($request, $order)
                                {
                                    $totalCost = $request->REQUEST['total_cost'];
                                    $spareCost = $request->REQUEST['spare_cost'];
                                    $commission = ($totalCost - $spareCost) * 0.2;
                            Severity: Minor
                            Found in src/Shop/Order/Event/DigiDoki.php - About 1 hr to fix

                              Method init has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function init()
                                  {
                                      parent::init();
                                      $this->_a['table'] = 'shop_product';
                                      $this->_a['verbose'] = 'Shop_Product';
                              Severity: Minor
                              Found in src/Shop/Product.php - About 1 hr to fix

                                Method init has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function init()
                                    {
                                        $this->_a['table'] = 'shop_order_metafields';
                                        $this->_a['verbose'] = 'Shop_OrderMetafield';
                                        $this->_a['cols'] = array(
                                Severity: Minor
                                Found in src/Shop/OrderMetafield.php - About 1 hr to fix

                                  Method initFields has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function initFields($extra = array())
                                      {
                                          $this->user = $extra['user'];
                                          
                                          $this->fields['title'] = new Pluf_Form_Field_Varchar(array(
                                  Severity: Minor
                                  Found in src/Shop/Form/OrderCreate.php - About 1 hr to fix

                                    Method init has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function init()
                                        {
                                            $this->_a['table'] = 'shop_tax_class';
                                            $this->_a['verbose'] = 'Shop_TaxClass';
                                            $this->_a['cols'] = array(
                                    Severity: Minor
                                    Found in src/Shop/TaxClass.php - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language