Showing 65 of 1,795 total issues

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

    Method getGeneralParam has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getGeneralParam()
        {
            $params = array();
            $params[] = array(
                'name' => 'title',
    Severity: Minor
    Found in src/Notifier/Engine.php - About 1 hr to fix

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

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

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

            function init()
            {
                $this->_a['table'] = 'shop_contact';
                $this->_a['verbose'] = 'Shop_Contact';
                $this->_a['multitenant'] = false;
        Severity: Minor
        Found in src/Shop/Contact.php - About 1 hr to fix

          Method members has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function members($request, $match)
              {
                  $zone = Pluf_Shortcuts_GetObjectOr404('Shop_Zone', $match['zoneId']);
                  $user = new User_Account();
                  $associationTable = Shop_Shortcuts_GetAssociationTableName($zone, $user);
          Severity: Minor
          Found in src/Shop/Views/Zone.php - About 1 hr to fix

            Method find has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function find($request, $match)
                {
                    $order = new Shop_Order();
                    $pag = new Pluf_Paginator($order);
                    $manager = $order->getManager();
            Severity: Minor
            Found in src/Shop/Views/Order.php - About 1 hr to fix

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

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

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

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

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

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

                    Method pay has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function pay($request, $match)
                        {
                            /**
                             *
                             * @var Shop_Order $order
                    Severity: Minor
                    Found in src/Shop/Views/Order.php - About 1 hr to fix

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

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

                        Method find has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function find($request, $match)
                            {
                                if (isset($match['secureId'])) {
                                    $order = Shop_Shortcuts_GetObjectBySecureIdOr404('Shop_Order', $match['secureId']);
                                } else {
                        Severity: Minor
                        Found in src/Shop/Views/OrderHistory.php - About 1 hr to fix

                          Method items has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function items($request, $match)
                              {
                                  $category = Pluf_Shortcuts_GetObjectOr404('Shop_Category', $match['categoryId']);
                                  $model = Shop_Views_Category::itemModel($request, $match);
                                  $item = Pluf::factory($model);
                          Severity: Minor
                          Found in src/Shop/Views/Category.php - About 1 hr to fix

                            Method categories has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function categories($request, $match, $p)
                                {
                                    $model = $p['model'];
                                    $item = Pluf_Shortcuts_GetObjectOr404($model, $match['modelId']);
                                    $category = new Shop_Category();
                            Severity: Minor
                            Found in src/Shop/Views.php - About 1 hr to fix

                              Method sendSms has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function sendSms($data)
                                  {
                                      // Mobile number
                                      $receiver = array_key_exists('receiver', $data) ? $data['receiver'] : null;
                                      if (! $receiver) {
                              Severity: Minor
                              Found in src/Notifier/Engine/SmsIr.php - About 1 hr to fix

                                Method tags has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public static function tags($request, $match, $p)
                                    {
                                        $model = $p['model'];
                                        $item = Pluf_Shortcuts_GetObjectOr404($model, $match['modelId']);
                                        $tag = new Shop_Tag();
                                Severity: Minor
                                Found in src/Shop/Views.php - About 1 hr to fix

                                  Function createOrderFilter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function createOrderFilter($request)
                                      {
                                          $sql = new Pluf_SQL('deleted=%d', array(
                                              FALSE
                                          ));
                                  Severity: Minor
                                  Found in src/Shop/Order/Manager/Simple.php - About 1 hr 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

                                  Method items has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function items($request, $match)
                                      {
                                          $tag = Pluf_Shortcuts_GetObjectOr404('Shop_Tag', $match['tagId']);
                                          $model = Shop_Views_Tag::itemModel($request, $match);
                                          $item = Pluf::factory($model);
                                  Severity: Minor
                                  Found in src/Shop/Views/Tag.php - About 1 hr to fix

                                    Method productTaxes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public static function productTaxes ($request, $match)
                                        {
                                            $product = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['productId']);
                                            $tax = new Shop_TaxClass();
                                            $taxTable = $tax->_a['table'];
                                    Severity: Minor
                                    Found in src/Shop/Views/Tax.php - About 1 hr to fix

                                      Method getStates has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function getStates()
                                          {
                                              return array(
                                                  Workflow\Machine::STATE_UNDEFINED => array(
                                                      'next' => 'Live'
                                      Severity: Minor
                                      Found in src/Shop/Order/Manager/Default.php - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language