tddwizard/magento2-fixtures

View on GitHub

Showing 8 of 61 total issues

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

    public function build(): Order
    {
        $builder = clone $this;

        if (empty($builder->productBuilders)) {
Severity: Minor
Found in src/Sales/OrderBuilder.php - About 1 hr to fix

    Method aSimpleProduct has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function aSimpleProduct(): ProductBuilder
        {
            $objectManager = Bootstrap::getObjectManager();
            /** @var Product $product */
            $product = $objectManager->create(ProductInterface::class);
    Severity: Minor
    Found in src/Catalog/ProductBuilder.php - About 1 hr to fix

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

              AddressRepositoryInterface $addressRepository,
              CartRepositoryInterface $quoteRepository,
              QuoteManagement $quoteManagement,
              PaymentConfig $paymentConfig,
              Cart $cart,
      Severity: Major
      Found in src/Checkout/CustomerCheckout.php - About 1 hr to fix

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

                ProductRepositoryInterface $productRepository,
                StockItemRepositoryInterface $stockItemRepository,
                ProductWebsiteLinkRepositoryInterface $websiteLinkRepository,
                ProductWebsiteLinkInterfaceFactory $websiteLinkFactory,
                IndexerFactory $indexerFactory,
        Severity: Major
        Found in src/Catalog/ProductBuilder.php - About 1 hr to fix

          Function build has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function build(): Order
              {
                  $builder = clone $this;
          
                  if (empty($builder->productBuilders)) {
          Severity: Minor
          Found in src/Sales/OrderBuilder.php - About 55 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

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

                  CategoryRepositoryInterface $categoryRepository,
                  CategoryResource $categoryResource,
                  CategoryLinkRepositoryInterface $categoryLinkRepository,
                  CategoryProductLinkInterfaceFactory $productLinkFactory,
                  Category $category,
          Severity: Minor
          Found in src/Catalog/CategoryBuilder.php - About 45 mins to fix

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

                    ShipmentItemCreationInterfaceFactory $itemFactory,
                    ShipmentTrackCreationInterfaceFactory $trackFactory,
                    ShipOrderInterface $shipOrder,
                    ShipmentRepositoryInterface $shipmentRepository,
                    Order $order
            Severity: Minor
            Found in src/Sales/ShipmentBuilder.php - About 35 mins to fix

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

                      CustomerRepositoryInterface $customerRepository,
                      CustomerInterface $customer,
                      Encryptor $encryptor,
                      string $password,
                      AddressBuilder ...$addressBuilders
              Severity: Minor
              Found in src/Customer/CustomerBuilder.php - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language