graycoreio/daffodil

View on GitHub
libs/cart/driver/in-memory/src/helpers/compute-cart-totals.ts

Summary

Maintainability
A
1 hr
Test Coverage

Function daffCartInMemoryComputeCartTotals has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function daffCartInMemoryComputeCartTotals(cart: DaffCart, products: DaffProduct[]): DaffCart {
  const shipping = cart.shipping_information ? faker.datatype.number({ min: 0, max: 99 }) : 0;
  const subtotalExcludingTax = cart.items?.reduce((acc, { product_id }) =>
    acc + (products.find(({ id }) => id === product_id)?.price || 0),
  0,
Severity: Minor
Found in libs/cart/driver/in-memory/src/helpers/compute-cart-totals.ts - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status