inklabs/kommerce-core

View on GitHub

Showing 254 of 254 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php
namespace inklabs\kommerce\EntityDTO\Builder;

use inklabs\kommerce\Entity\CartPriceRuleProductItem;
use inklabs\kommerce\EntityDTO\CartPriceRuleProductItemDTO;
Severity: Minor
Found in src/EntityDTO/Builder/CartPriceRuleProductItemDTOBuilder.php and 1 other location - About 45 mins to fix
src/EntityDTO/Builder/CartPriceRuleTagItemDTOBuilder.php on lines 1..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

<?php
namespace inklabs\kommerce\Action\User;

use inklabs\kommerce\Lib\Command\CommandInterface;

Severity: Major
Found in src/Action/User/LoginWithTokenCommand.php and 2 other locations - About 40 mins to fix
src/Action/User/LoginCommand.php on lines 1..38
src/Action/User/ResetPasswordCommand.php on lines 1..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

<?php
namespace inklabs\kommerce\Action\User;

use inklabs\kommerce\Lib\Command\CommandInterface;

Severity: Major
Found in src/Action/User/LoginCommand.php and 2 other locations - About 40 mins to fix
src/Action/User/LoginWithTokenCommand.php on lines 1..38
src/Action/User/ResetPasswordCommand.php on lines 1..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

<?php
namespace inklabs\kommerce\Action\User;

use inklabs\kommerce\Lib\Command\CommandInterface;

Severity: Major
Found in src/Action/User/ResetPasswordCommand.php and 2 other locations - About 40 mins to fix
src/Action/User/LoginCommand.php on lines 1..38
src/Action/User/LoginWithTokenCommand.php on lines 1..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php
namespace inklabs\kommerce\Entity;

use inklabs\kommerce\Lib\Event\EventInterface;

Severity: Minor
Found in src/Entity/EventGeneratorTrait.php and 1 other location - About 40 mins to fix
src/Event/RaiseEventTrait.php on lines 1..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 93.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php
namespace inklabs\kommerce\Event;

use inklabs\kommerce\Lib\Event\EventInterface;

Severity: Minor
Found in src/Event/RaiseEventTrait.php and 1 other location - About 40 mins to fix
src/Entity/EventGeneratorTrait.php on lines 1..29

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 93.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method addShipmentTrackingCode has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        UuidInterface $orderId,
        OrderItemQtyDTO $orderItemQtyDTO,
        string $comment,
        int $shipmentCarrierTypeId,
        string $trackingCode
Severity: Minor
Found in src/Service/OrderServiceInterface.php - About 35 mins to fix

    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            string $orderId,
            OrderItemQtyDTO $orderItemQtyDTO,
            string $comment,
            string $shipmentExternalId,
            string $rateExternalId
    Severity: Minor
    Found in src/Action/Shipment/BuyShipmentLabelCommand.php - About 35 mins to fix

      Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              CartRepositoryInterface $cartRepository,
              OrderRepositoryInterface $orderRepository,
              ?string $sessionId = null,
              UuidInterface $userId = null,
              bool $isAdmin = false
      Severity: Minor
      Found in src/Lib/Authorization/SessionAuthorizationContext.php - About 35 mins to fix

        Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                string $orderId,
                OrderItemQtyDTO $orderItemQtyDTO,
                string $comment,
                int $carrier,
                string $trackingCode
        Severity: Minor
        Found in src/Action/Shipment/AddShipmentTrackingCodeCommand.php - About 35 mins to fix

          Method recordLogin has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  string $email,
                  string $ip4,
                  UserLoginResultType $result,
                  User $user = null,
                  UserToken $userToken = null
          Severity: Minor
          Found in src/Service/UserService.php - About 35 mins to fix

            Method createZip5Range has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    string $zip5From,
                    string $zip5To,
                    float $rate,
                    bool $applyToShipping,
                    UuidInterface $id = null
            Severity: Minor
            Found in src/Entity/TaxRate.php - About 35 mins to fix

              Method buyShipmentLabel has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      UuidInterface $orderId,
                      OrderItemQtyDTO $orderItemQtyDTO,
                      string $comment,
                      string $rateExternalId,
                      string $shipmentExternalId
              Severity: Minor
              Found in src/Service/OrderService.php - About 35 mins to fix

                Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        UserLoginResultType $result,
                        string $email,
                        string $ip4,
                        User $user = null,
                        UserToken $userToken = null
                Severity: Minor
                Found in src/Entity/UserLogin.php - About 35 mins to fix

                  Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          AttachmentRepositoryInterface $attachmentRepository,
                          FileManagerInterface $fileManager,
                          OrderItemRepositoryInterface $orderItemRepository,
                          ProductRepositoryInterface $productRepository,
                          UserRepositoryInterface $userRepository
                  Severity: Minor
                  Found in src/Service/AttachmentService.php - About 35 mins to fix

                    Method addShipmentTrackingCode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            UuidInterface $orderId,
                            OrderItemQtyDTO $orderItemQtyDTO,
                            string $comment,
                            int $shipmentCarrierTypeId,
                            string $trackingCode
                    Severity: Minor
                    Found in src/Service/OrderService.php - About 35 mins to fix

                      Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              string $name,
                              ?int $maxRedemptions,
                              bool $reducesTaxSubtotal,
                              ?int $startAt,
                              ?int $endAt
                      Severity: Minor
                      Found in src/Action/CartPriceRule/CreateCartPriceRuleCommand.php - About 35 mins to fix

                        Method fromCart has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                UuidInterface $orderId,
                                User $user,
                                Cart $cart,
                                CartCalculatorInterface $cartCalculator,
                                string $ip4
                        Severity: Minor
                        Found in src/Entity/Order.php - About 35 mins to fix

                          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  string $name,
                                  int $sortOrder,
                                  ?string $sku,
                                  ?string $description,
                                  string $attributeId
                          Severity: Minor
                          Found in src/Action/Attribute/CreateAttributeValueCommand.php - About 35 mins to fix

                            Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    string $name,
                                    int $sortOrder,
                                    ?string $sku,
                                    ?string $description,
                                    string $attributeValueId
                            Severity: Minor
                            Found in src/Action/Attribute/UpdateAttributeValueCommand.php - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language