inklabs/kommerce-core

View on GitHub

Showing 254 of 254 total issues

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

    public function getAllUserLogins(string $queryString = null, Pagination & $pagination = null)
    {
        $query = $this->getQueryBuilder()
            ->select('UserLogin')
            ->from(UserLogin::class, 'UserLogin');
Severity: Major
Found in src/EntityRepository/UserLoginRepository.php and 2 other locations - About 1 hr to fix
src/EntityRepository/CartPriceRuleRepository.php on lines 9..25
src/EntityRepository/CatalogPromotionRepository.php on lines 9..25

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 110.

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

    public function getAllCartPriceRules(string $queryString = null, Pagination & $pagination = null)
    {
        $query = $this->getQueryBuilder()
            ->select('CartPriceRule')
            ->from(CartPriceRule::class, 'CartPriceRule');
Severity: Major
Found in src/EntityRepository/CartPriceRuleRepository.php and 2 other locations - About 1 hr to fix
src/EntityRepository/CatalogPromotionRepository.php on lines 9..25
src/EntityRepository/UserLoginRepository.php on lines 21..37

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 110.

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 import has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function import(Iterator $iterator): ImportResult
    {
        $importResult = new ImportResult;
        foreach ($iterator as $key => $row) {
            if ($key < 2 && $row[0] === 'order_ref') {
Severity: Minor
Found in src/Service/Import/ImportOrderService.php - About 1 hr to fix

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

    <?php
    namespace inklabs\kommerce\ActionHandler\User;
    
    use inklabs\kommerce\Action\User\LoginWithTokenCommand;
    use inklabs\kommerce\Lib\Authorization\AuthorizationContextInterface;
    Severity: Major
    Found in src/ActionHandler/User/LoginWithTokenHandler.php and 2 other locations - About 1 hr to fix
    src/ActionHandler/Attachment/CreateAttachmentForUserProductHandler.php on lines 1..38
    src/ActionHandler/User/LoginHandler.php on lines 1..36

    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 109.

    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\ActionHandler\User;
    
    use inklabs\kommerce\Action\User\LoginCommand;
    use inklabs\kommerce\Lib\Authorization\AuthorizationContextInterface;
    Severity: Major
    Found in src/ActionHandler/User/LoginHandler.php and 2 other locations - About 1 hr to fix
    src/ActionHandler/Attachment/CreateAttachmentForUserProductHandler.php on lines 1..38
    src/ActionHandler/User/LoginWithTokenHandler.php on lines 1..36

    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 109.

    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\ActionHandler\Attachment;
    
    use inklabs\kommerce\Action\Attachment\CreateAttachmentForUserProductCommand;
    use inklabs\kommerce\Lib\Authorization\AuthorizationContextInterface;
    src/ActionHandler/User/LoginHandler.php on lines 1..36
    src/ActionHandler/User/LoginWithTokenHandler.php on lines 1..36

    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 109.

    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\EntityDTO\Builder;
    
    use inklabs\kommerce\Entity\Money;
    use inklabs\kommerce\EntityDTO\MoneyDTO;
    Severity: Major
    Found in src/EntityDTO/Builder/MoneyDTOBuilder.php and 1 other location - About 1 hr to fix
    src/EntityDTO/Builder/PointDTOBuilder.php on lines 1..34

    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 109.

    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\EntityDTO\Builder;
    
    use inklabs\kommerce\Entity\Point;
    use inklabs\kommerce\EntityDTO\PointDTO;
    Severity: Major
    Found in src/EntityDTO/Builder/PointDTOBuilder.php and 1 other location - About 1 hr to fix
    src/EntityDTO/Builder/MoneyDTOBuilder.php on lines 1..34

    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 109.

    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

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

        public function import(Iterator $iterator): ImportResult
        {
            $importResult = new ImportResult;
            foreach ($iterator as $key => $row) {
                if ($key < 2 && $row[0] === 'order_ref') {
    Severity: Minor
    Found in src/Service/Import/ImportOrderService.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 loadValidatorMetadata has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function loadValidatorMetadata(ClassMetadata $metadata)
        {
            $metadata->addPropertyConstraint('attention', new Assert\NotBlank);
            $metadata->addPropertyConstraint('attention', new Assert\Length([
                'max' => 128,
    Severity: Minor
    Found in src/Entity/Address.php - About 1 hr to fix

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

              string $name,
              string $attention,
              string $company,
              string $address1,
              string $address2,
      Severity: Major
      Found in src/Action/Warehouse/CreateWarehouseCommand.php - About 1 hr to fix

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

        <?php
        namespace inklabs\kommerce\ActionHandler\Option;
        
        use inklabs\kommerce\Action\Option\DeleteOptionValueCommand;
        use inklabs\kommerce\EntityRepository\OptionValueRepositoryInterface;
        Severity: Major
        Found in src/ActionHandler/Option/DeleteOptionValueHandler.php and 15 other locations - About 1 hr to fix
        src/ActionHandler/Attachment/DeleteAttachmentHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeValueHandler.php on lines 1..38
        src/ActionHandler/Attribute/DeleteProductAttributeHandler.php on lines 1..38
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleDiscountHandler.php on lines 1..39
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleHandler.php on lines 1..37
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleItemHandler.php on lines 1..39
        src/ActionHandler/CatalogPromotion/DeleteCatalogPromotionHandler.php on lines 1..39
        src/ActionHandler/Coupon/DeleteCouponHandler.php on lines 1..33
        src/ActionHandler/Option/DeleteOptionHandler.php on lines 1..35
        src/ActionHandler/Product/DeleteProductHandler.php on lines 1..33
        src/ActionHandler/Tag/DeleteTagHandler.php on lines 1..33
        src/ActionHandler/TaxRate/DeleteTaxRateHandler.php on lines 1..35
        src/ActionHandler/Warehouse/DeleteInventoryLocationHandler.php on lines 1..37
        src/ActionHandler/Warehouse/DeleteWarehouseHandler.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 108.

        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 16 locations. Consider refactoring.
        Open

        <?php
        namespace inklabs\kommerce\ActionHandler\Warehouse;
        
        use inklabs\kommerce\Action\Warehouse\DeleteWarehouseCommand;
        use inklabs\kommerce\EntityRepository\WarehouseRepositoryInterface;
        Severity: Major
        Found in src/ActionHandler/Warehouse/DeleteWarehouseHandler.php and 15 other locations - About 1 hr to fix
        src/ActionHandler/Attachment/DeleteAttachmentHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeValueHandler.php on lines 1..38
        src/ActionHandler/Attribute/DeleteProductAttributeHandler.php on lines 1..38
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleDiscountHandler.php on lines 1..39
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleHandler.php on lines 1..37
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleItemHandler.php on lines 1..39
        src/ActionHandler/CatalogPromotion/DeleteCatalogPromotionHandler.php on lines 1..39
        src/ActionHandler/Coupon/DeleteCouponHandler.php on lines 1..33
        src/ActionHandler/Option/DeleteOptionHandler.php on lines 1..35
        src/ActionHandler/Option/DeleteOptionValueHandler.php on lines 1..37
        src/ActionHandler/Product/DeleteProductHandler.php on lines 1..33
        src/ActionHandler/Tag/DeleteTagHandler.php on lines 1..33
        src/ActionHandler/TaxRate/DeleteTaxRateHandler.php on lines 1..35
        src/ActionHandler/Warehouse/DeleteInventoryLocationHandler.php on lines 1..37

        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 108.

        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 16 locations. Consider refactoring.
        Open

        <?php
        namespace inklabs\kommerce\ActionHandler\Warehouse;
        
        use inklabs\kommerce\Action\Warehouse\DeleteInventoryLocationCommand;
        use inklabs\kommerce\EntityRepository\InventoryLocationRepositoryInterface;
        src/ActionHandler/Attachment/DeleteAttachmentHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeValueHandler.php on lines 1..38
        src/ActionHandler/Attribute/DeleteProductAttributeHandler.php on lines 1..38
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleDiscountHandler.php on lines 1..39
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleHandler.php on lines 1..37
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleItemHandler.php on lines 1..39
        src/ActionHandler/CatalogPromotion/DeleteCatalogPromotionHandler.php on lines 1..39
        src/ActionHandler/Coupon/DeleteCouponHandler.php on lines 1..33
        src/ActionHandler/Option/DeleteOptionHandler.php on lines 1..35
        src/ActionHandler/Option/DeleteOptionValueHandler.php on lines 1..37
        src/ActionHandler/Product/DeleteProductHandler.php on lines 1..33
        src/ActionHandler/Tag/DeleteTagHandler.php on lines 1..33
        src/ActionHandler/TaxRate/DeleteTaxRateHandler.php on lines 1..35
        src/ActionHandler/Warehouse/DeleteWarehouseHandler.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 108.

        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 16 locations. Consider refactoring.
        Open

        <?php
        namespace inklabs\kommerce\ActionHandler\Coupon;
        
        use inklabs\kommerce\Action\Coupon\DeleteCouponCommand;
        use inklabs\kommerce\EntityRepository\CouponRepositoryInterface;
        Severity: Major
        Found in src/ActionHandler/Coupon/DeleteCouponHandler.php and 15 other locations - About 1 hr to fix
        src/ActionHandler/Attachment/DeleteAttachmentHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeValueHandler.php on lines 1..38
        src/ActionHandler/Attribute/DeleteProductAttributeHandler.php on lines 1..38
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleDiscountHandler.php on lines 1..39
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleHandler.php on lines 1..37
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleItemHandler.php on lines 1..39
        src/ActionHandler/CatalogPromotion/DeleteCatalogPromotionHandler.php on lines 1..39
        src/ActionHandler/Option/DeleteOptionHandler.php on lines 1..35
        src/ActionHandler/Option/DeleteOptionValueHandler.php on lines 1..37
        src/ActionHandler/Product/DeleteProductHandler.php on lines 1..33
        src/ActionHandler/Tag/DeleteTagHandler.php on lines 1..33
        src/ActionHandler/TaxRate/DeleteTaxRateHandler.php on lines 1..35
        src/ActionHandler/Warehouse/DeleteInventoryLocationHandler.php on lines 1..37
        src/ActionHandler/Warehouse/DeleteWarehouseHandler.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 108.

        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 16 locations. Consider refactoring.
        Open

        <?php
        namespace inklabs\kommerce\ActionHandler\Attribute;
        
        use inklabs\kommerce\Action\Attribute\DeleteProductAttributeCommand;
        use inklabs\kommerce\EntityRepository\ProductAttributeRepositoryInterface;
        src/ActionHandler/Attachment/DeleteAttachmentHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeValueHandler.php on lines 1..38
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleDiscountHandler.php on lines 1..39
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleHandler.php on lines 1..37
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleItemHandler.php on lines 1..39
        src/ActionHandler/CatalogPromotion/DeleteCatalogPromotionHandler.php on lines 1..39
        src/ActionHandler/Coupon/DeleteCouponHandler.php on lines 1..33
        src/ActionHandler/Option/DeleteOptionHandler.php on lines 1..35
        src/ActionHandler/Option/DeleteOptionValueHandler.php on lines 1..37
        src/ActionHandler/Product/DeleteProductHandler.php on lines 1..33
        src/ActionHandler/Tag/DeleteTagHandler.php on lines 1..33
        src/ActionHandler/TaxRate/DeleteTaxRateHandler.php on lines 1..35
        src/ActionHandler/Warehouse/DeleteInventoryLocationHandler.php on lines 1..37
        src/ActionHandler/Warehouse/DeleteWarehouseHandler.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 108.

        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 16 locations. Consider refactoring.
        Open

        <?php
        namespace inklabs\kommerce\ActionHandler\CartPriceRule;
        
        use inklabs\kommerce\Action\CartPriceRule\DeleteCartPriceRuleDiscountCommand;
        use inklabs\kommerce\EntityRepository\CartPriceRuleDiscountRepositoryInterface;
        src/ActionHandler/Attachment/DeleteAttachmentHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeValueHandler.php on lines 1..38
        src/ActionHandler/Attribute/DeleteProductAttributeHandler.php on lines 1..38
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleHandler.php on lines 1..37
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleItemHandler.php on lines 1..39
        src/ActionHandler/CatalogPromotion/DeleteCatalogPromotionHandler.php on lines 1..39
        src/ActionHandler/Coupon/DeleteCouponHandler.php on lines 1..33
        src/ActionHandler/Option/DeleteOptionHandler.php on lines 1..35
        src/ActionHandler/Option/DeleteOptionValueHandler.php on lines 1..37
        src/ActionHandler/Product/DeleteProductHandler.php on lines 1..33
        src/ActionHandler/Tag/DeleteTagHandler.php on lines 1..33
        src/ActionHandler/TaxRate/DeleteTaxRateHandler.php on lines 1..35
        src/ActionHandler/Warehouse/DeleteInventoryLocationHandler.php on lines 1..37
        src/ActionHandler/Warehouse/DeleteWarehouseHandler.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 108.

        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 16 locations. Consider refactoring.
        Open

        <?php
        namespace inklabs\kommerce\ActionHandler\Attachment;
        
        use inklabs\kommerce\Action\Attachment\DeleteAttachmentCommand;
        use inklabs\kommerce\EntityRepository\AttachmentRepositoryInterface;
        Severity: Major
        Found in src/ActionHandler/Attachment/DeleteAttachmentHandler.php and 15 other locations - About 1 hr to fix
        src/ActionHandler/Attribute/DeleteAttributeHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeValueHandler.php on lines 1..38
        src/ActionHandler/Attribute/DeleteProductAttributeHandler.php on lines 1..38
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleDiscountHandler.php on lines 1..39
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleHandler.php on lines 1..37
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleItemHandler.php on lines 1..39
        src/ActionHandler/CatalogPromotion/DeleteCatalogPromotionHandler.php on lines 1..39
        src/ActionHandler/Coupon/DeleteCouponHandler.php on lines 1..33
        src/ActionHandler/Option/DeleteOptionHandler.php on lines 1..35
        src/ActionHandler/Option/DeleteOptionValueHandler.php on lines 1..37
        src/ActionHandler/Product/DeleteProductHandler.php on lines 1..33
        src/ActionHandler/Tag/DeleteTagHandler.php on lines 1..33
        src/ActionHandler/TaxRate/DeleteTaxRateHandler.php on lines 1..35
        src/ActionHandler/Warehouse/DeleteInventoryLocationHandler.php on lines 1..37
        src/ActionHandler/Warehouse/DeleteWarehouseHandler.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 108.

        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 16 locations. Consider refactoring.
        Open

        <?php
        namespace inklabs\kommerce\ActionHandler\CartPriceRule;
        
        use inklabs\kommerce\Action\CartPriceRule\DeleteCartPriceRuleItemCommand;
        use inklabs\kommerce\EntityRepository\CartPriceRuleItemRepositoryInterface;
        src/ActionHandler/Attachment/DeleteAttachmentHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeValueHandler.php on lines 1..38
        src/ActionHandler/Attribute/DeleteProductAttributeHandler.php on lines 1..38
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleDiscountHandler.php on lines 1..39
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleHandler.php on lines 1..37
        src/ActionHandler/CatalogPromotion/DeleteCatalogPromotionHandler.php on lines 1..39
        src/ActionHandler/Coupon/DeleteCouponHandler.php on lines 1..33
        src/ActionHandler/Option/DeleteOptionHandler.php on lines 1..35
        src/ActionHandler/Option/DeleteOptionValueHandler.php on lines 1..37
        src/ActionHandler/Product/DeleteProductHandler.php on lines 1..33
        src/ActionHandler/Tag/DeleteTagHandler.php on lines 1..33
        src/ActionHandler/TaxRate/DeleteTaxRateHandler.php on lines 1..35
        src/ActionHandler/Warehouse/DeleteInventoryLocationHandler.php on lines 1..37
        src/ActionHandler/Warehouse/DeleteWarehouseHandler.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 108.

        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 16 locations. Consider refactoring.
        Open

        <?php
        namespace inklabs\kommerce\ActionHandler\Attribute;
        
        use inklabs\kommerce\Action\Attribute\DeleteAttributeValueCommand;
        use inklabs\kommerce\EntityRepository\AttributeRepositoryInterface;
        src/ActionHandler/Attachment/DeleteAttachmentHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteAttributeHandler.php on lines 1..37
        src/ActionHandler/Attribute/DeleteProductAttributeHandler.php on lines 1..38
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleDiscountHandler.php on lines 1..39
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleHandler.php on lines 1..37
        src/ActionHandler/CartPriceRule/DeleteCartPriceRuleItemHandler.php on lines 1..39
        src/ActionHandler/CatalogPromotion/DeleteCatalogPromotionHandler.php on lines 1..39
        src/ActionHandler/Coupon/DeleteCouponHandler.php on lines 1..33
        src/ActionHandler/Option/DeleteOptionHandler.php on lines 1..35
        src/ActionHandler/Option/DeleteOptionValueHandler.php on lines 1..37
        src/ActionHandler/Product/DeleteProductHandler.php on lines 1..33
        src/ActionHandler/Tag/DeleteTagHandler.php on lines 1..33
        src/ActionHandler/TaxRate/DeleteTaxRateHandler.php on lines 1..35
        src/ActionHandler/Warehouse/DeleteInventoryLocationHandler.php on lines 1..37
        src/ActionHandler/Warehouse/DeleteWarehouseHandler.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 108.

        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

        Severity
        Category
        Status
        Source
        Language