Showing 65 of 1,795 total issues

Method find has 34 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/OrderItem.php - About 1 hr to fix

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

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

      Method createOrderFilter has 32 lines of code (exceeds 25 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

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

            public static function find($request, $match)
            {
                $address = new Shop_Address();
                $pag = new Pluf_Paginator($address);
                if(User_Precondition::ownerRequired($request)){            
        Severity: Minor
        Found in src/Shop/Views/Address.php - About 1 hr to fix

          Method addOrderHistory has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function addOrderHistory($signal, $event)
              {
                  switch ($event->event) {
                      case 'set_zone':
                          $object = $event->object->get_zone();
          Severity: Minor
          Found in src/Shop/Order/Manager/Abstract.php - About 1 hr to fix

            Method get has 29 lines of code (exceeds 25 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 1 hr to fix

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

                  public static function find($request, $match)
                  {
                      $item = Pluf_Shortcuts_GetObjectOr404('Shop_Service', $match['modelId']);
                      $paginator = new Pluf_Paginator(Pluf::factory('Shop_ServiceMetafield'));
                      $sql = new Pluf_SQL('service_id=%s', array(
              Severity: Minor
              Found in src/Shop/Views/ServiceMetafield.php - About 1 hr to fix

                Method get has 29 lines of code (exceeds 25 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 1 hr to fix

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

                      public static function find($request, $match)
                      {
                          $item = Pluf_Shortcuts_GetObjectOr404('Shop_Product', $match['modelId']);
                          $paginator = new Pluf_Paginator(Pluf::factory('Shop_ProductMetafield'));
                          $sql = new Pluf_SQL('product_id=%s', array(
                  Severity: Minor
                  Found in src/Shop/Views/ProductMetafield.php - About 1 hr to fix

                    Method upload has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

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

                          public static function find($request, $match)
                          {
                              $contact = new Shop_Contact();
                              $pag = new Pluf_Paginator($contact);
                              if (User_Precondition::ownerRequired($request)) {
                      Severity: Minor
                      Found in src/Shop/Views/Contact.php - About 1 hr to fix

                        Method create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Function save has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function save($commit = true)
                              {
                                  $model = parent::save(false);
                                  // update the content
                                  if (array_key_exists('file', $this->cleaned_data)) {
                          Severity: Minor
                          Found in src/Shop/Form/OrderAttachmentUpdate.php - About 45 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

                          Function getMetafieldByIdOrKey has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private static function getMetafieldByIdOrKey($request, $match){
                                  $mfId = null;
                                  // Extract metafield id (if exist)
                                  if (isset($match['id'])) {
                                      $mfId = $match['id'];
                          Severity: Minor
                          Found in src/Shop/Views/ServiceMetafield.php - About 45 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

                          Function getMetafieldByIdOrKey has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private static function getMetafieldByIdOrKey($request, $match){
                                  $mfId = null;
                                  // Extract metafield id (if exist)
                                  if (isset($match['id'])) {
                                      $mfId = $match['id'];
                          Severity: Minor
                          Found in src/Shop/Views/ProductMetafield.php - About 45 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

                          Function transferCommission has a Cognitive Complexity of 8 (exceeds 5 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 45 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

                          Function upload has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function upload($request, $match)
                              {
                                  $order = null;
                                  if (isset($match['secureId'])) {
                                      $order = Shop_Shortcuts_GetObjectBySecureIdOr404('Shop_Order', $match['secureId']);
                          Severity: Minor
                          Found in src/Shop/Views/OrderAttachment.php - About 35 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

                          Function create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function create($request, $match)
                              {
                                  $user = $request->user;
                                  $data = $request->REQUEST;
                                  if (isset($user)) {
                          Severity: Minor
                          Found in src/Shop/Views/Order.php - About 35 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

                          Function create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function create($request, $match)
                              {
                                  // TODO: Hadi: if item is added previously to order it is good to increase its count only
                                  /**
                                   *
                          Severity: Minor
                          Found in src/Shop/Views/OrderItem.php - About 35 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

                          Function create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function create($request, $match)
                              {
                                  $order = null;
                                  if (isset($match['secureId'])) {
                                      $order = Shop_Shortcuts_GetObjectBySecureIdOr404('Shop_Order', $match['secureId']);
                          Severity: Minor
                          Found in src/Shop/Views/OrderAttachment.php - About 35 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

                          Severity
                          Category
                          Status
                          Source
                          Language