graycoreio/daffodil

View on GitHub

Showing 120 of 122 total issues

File cart.facade.ts has 266 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  Inject,
  Injectable,
} from '@angular/core';
import { Dictionary } from '@ngrx/entity';
Severity: Minor
Found in libs/cart/state/src/facades/cart/cart.facade.ts - About 2 hrs to fix

    File order.ts has 266 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
      daffAdd,
      daffSubtract,
    } from '@daffodil/core';
    import { MagentoDiscount } from '@daffodil/driver/magento';
    Severity: Minor
    Found in libs/customer-order/driver/magento/src/transforms/responses/order.ts - About 2 hrs to fix

      Function daffCustomerAddressEntitiesReducer has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function daffCustomerAddressEntitiesReducer<
        T extends DaffCustomerAddress = DaffCustomerAddress,
      >(
        state = daffCustomerAddressEntitiesAdapter<T>().getInitialState(),
        action: DaffCustomerAddressActions<T> | DaffCustomerActions): DaffOperationEntityState<T> {
      Severity: Major
      Found in libs/customer/state/src/reducers/address-entities/reducer.ts - About 2 hrs to fix

        Function constructor has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          constructor(private store: Store<DaffOrderStateRootSlice<T>>) {
            const {
              selectOrderIds,
              selectOrderEntities,
              selectOrders,
        Severity: Major
        Found in libs/order/state/src/facades/order/order.facade.ts - About 2 hrs to fix

          Function createCompositeProductAppliedOptionsEntitiesSelectors has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const createCompositeProductAppliedOptionsEntitiesSelectors = <T extends DaffProduct>(): DaffCompositeProductEntitiesMemoizedSelectors<T> => {
            const {
              selectCompositeProductState,
            } = getDaffCompositeProductFeatureSelector();
            const {

            Function daffCustomerPaymentEntitiesReducer has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function daffCustomerPaymentEntitiesReducer<
              TPayment extends DaffCustomerPayment = DaffCustomerPayment,
              TRequest extends DaffCustomerPaymentRequest = DaffCustomerPaymentRequest,
            >(
              state = daffCustomerPaymentEntitiesAdapter<TPayment>().getInitialState(),
            Severity: Major
            Found in libs/customer-payment/state/src/reducers/payment-entities/reducer.ts - About 2 hrs to fix

              Function transformCartTotals has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function transformCartTotals(cart: Partial<MagentoCart>): {totals: DaffCart['totals']} {
                const totalTax = cart.prices.applied_taxes ? cart.prices.applied_taxes.reduce((acc, tax) => (daffAdd(acc, tax.amount.value)), 0) : 0;
                return {
                  totals: {
                    [DaffCartTotalTypeEnum.grandTotal]: {

                Function cartReducer has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function cartReducer<T extends DaffCart = DaffCart>(
                  state = daffCartReducerInitialState,
                  action: ActionTypes<T>,
                ): DaffCartReducerState<T> {
                  switch (action.type) {
                Severity: Major
                Found in libs/cart/state/src/reducers/cart/cart.reducer.ts - About 2 hrs to fix

                  Function search has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    search(query: string, options: DaffSearchProductDriverOptions = {}): Observable<DaffSearchProductDriverResponse> {
                      const queryVariables = this.getVariables(options);
                  
                      return combineLatest([
                        this.apollo.query<MagentoSearchForProductsResponse>({
                  Severity: Minor
                  Found in libs/search-product/driver/magento/src/product-search.service.ts - About 1 hr to fix

                    Function forRoot has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      static forRoot(): ModuleWithProviders<DaffTestingCartDriverModule> {
                        return {
                          ngModule: DaffTestingCartDriverModule,
                          providers: [
                            {
                    Severity: Minor
                    Found in libs/cart/driver/testing/src/drivers/cart-driver.module.ts - About 1 hr to fix

                      Function forRoot has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        static forRoot(): ModuleWithProviders<DaffCartInMemoryDriverModule> {
                          return {
                            ngModule: DaffCartInMemoryDriverModule,
                            providers: [
                              {
                      Severity: Minor
                      Found in libs/cart/driver/in-memory/src/drivers/cart-driver.module.ts - About 1 hr to fix

                        Function cartCouponReducer has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function cartCouponReducer<T extends DaffCart = DaffCart>(
                          state = daffCartReducerInitialState,
                          action: ActionTypes<T>,
                        ): DaffCartReducerState<T> {
                          switch (action.type) {
                        Severity: Minor
                        Found in libs/cart/state/src/reducers/cart-coupon/cart-coupon.reducer.ts - About 1 hr to fix

                          Function createCategorySelectors has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const createCategorySelectors = <V extends DaffGenericCategory<V>, W extends DaffProduct>(): DaffCategoryMemoizedSelectors<V, W> => {
                            const { selectAllProducts,selectProductEntities } = getDaffProductSelectors<W>();
                          
                            const {
                              selectCategoryEntities,
                          Severity: Minor
                          Found in libs/category/state/src/selectors/category.selector.ts - About 1 hr to fix

                            Function createCartOrderSelectors has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const createCartOrderSelectors = <
                              T extends DaffCart = DaffCart,
                              V extends DaffCartOrderResult = DaffCartOrderResult,
                            >(): DaffCartOrderMemoizedSelectors<T, V> => {
                              const selectCartFeatureState = getDaffCartFeatureSelector<T, V>().selectCartFeatureState;
                            Severity: Minor
                            Found in libs/cart/state/src/selectors/cart-order/cart-order.selector.ts - About 1 hr to fix

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

                                get slideAnimation(): any {
                                  switch (this.toastPosition.config.horizontal + '-' + this.toastPosition.config.vertical) {
                                    case 'left-top':
                                    case 'left-bottom':
                                      return {
                              Severity: Minor
                              Found in libs/design/toast/src/toast/toast-template.component.ts - About 1 hr to fix

                                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

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

                                  export function daffCartOrderReducer<T extends DaffCartOrderResult = DaffCartOrderResult>(
                                    state = daffCartOrderInitialState,
                                    action: ActionTypes<
                                    DaffCart,
                                    DaffCartItemInput,
                                  Severity: Minor
                                  Found in libs/cart/state/src/reducers/cart-order/cart-order.reducer.ts - About 1 hr to fix

                                    Function daffCategoryPageMetadataReducer has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function daffCategoryPageMetadataReducer<U extends DaffGenericCategory<U>, W extends DaffProduct>(
                                      state = daffCategoryPageMetadataInitialState,
                                      action: DaffCategoryActions<U, W> | DaffCategoryPageActions<U, W> | DaffCategoryPageProductCollectionActions,
                                    ): DaffCategoryPageMetadataReducerState {
                                      const adapter = getCollectionStateAdapter<DaffCategoryPageMetadataReducerState>();
                                    Severity: Minor
                                    Found in libs/category/state/src/reducers/page-metadata/reducer.ts - About 1 hr to fix

                                      Function daffCartStoreCreditCartReducer has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function daffCartStoreCreditCartReducer<T extends DaffCartWithStoreCredit = DaffCartWithStoreCredit>(
                                        state = daffCartReducerInitialState,
                                        action: DaffCartStoreCreditActions,
                                      ): DaffCartReducerState<T> {
                                        switch (action.type) {
                                      Severity: Minor
                                      Found in libs/cart-store-credit/state/src/reducers/cart.reducer.ts - About 1 hr to fix

                                        Function daffAuthReducer has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function daffAuthReducer(
                                          state = daffAuthInitialState,
                                          action: DaffAuthActions | DaffAuthLoginActions | DaffAuthRegisterSuccess | DaffAuthResetPasswordActions,
                                        ): DaffAuthReducerState {
                                          switch (action.type) {
                                        Severity: Minor
                                        Found in libs/auth/state/src/reducers/auth/auth.reducer.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language