graycoreio/daffodil

View on GitHub

Showing 119 of 121 total issues

Function create has 467 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  create(): MagentoOrderTestData {
    const mockDaffOrderAddress: DaffOrderAddress = this.daffOrderAddressFactory.create({
      region: '5',
    });
    const mockDaffOrderCoupon: DaffOrderCoupon = this.daffOrderCouponFactory.create();
Severity: Major
Found in libs/order/driver/magento/2-4-1/src/helpers/test-data.service.ts - About 2 days to fix

    Function createCartSelectors has 328 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const createCartSelectors = <
      T extends DaffCart = DaffCart,
      V extends DaffCartOrderResult = DaffCartOrderResult,
    >(): DaffCartStateMemoizedSelectors<T, V> => {
      const selectCartFeatureState = getDaffCartFeatureSelector<T, V>().selectCartFeatureState;
    Severity: Major
    Found in libs/cart/state/src/selectors/cart/cart.selector.ts - About 1 day to fix

      File test-data.service.ts has 538 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { Injectable } from '@angular/core';
      
      import {
        DaffOrder,
        DaffOrderAddress,
      Severity: Major
      Found in libs/order/driver/magento/2-4-1/src/helpers/test-data.service.ts - About 1 day to fix

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

        import {
          createSelector,
          MemoizedSelector,
          DefaultProjectorFn,
        } from '@ngrx/store';
        Severity: Minor
        Found in libs/cart/state/src/selectors/cart/cart.selector.ts - About 6 hrs to fix

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

            constructor(
              private store: Store<DaffCartStateRootSlice<T, V>>,
              // typing this as `Record<string, any>` or `object` fails the build
              // because Angular explicitly types this as `Object`
              // eslint-disable-next-line @typescript-eslint/no-restricted-types
          Severity: Major
          Found in libs/cart/state/src/facades/cart/cart.facade.ts - About 5 hrs to fix

            Function createOrderEntitySelectors has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

            const createOrderEntitySelectors = <T extends DaffOrder = DaffOrder>() => {
              const { selectOrderFeatureState } = getDaffOrderReducersStateSelector<T>();
              const selectOrderEntitiesState = createSelector(
                selectOrderFeatureState,
                state => state.orders,
            Severity: Minor
            Found in libs/order/state/src/selectors/order-entities.selector.ts - About 5 hrs 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

            Function createOrderEntitySelectors has 129 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const createOrderEntitySelectors = <T extends DaffOrder = DaffOrder>() => {
              const { selectOrderFeatureState } = getDaffOrderReducersStateSelector<T>();
              const selectOrderEntitiesState = createSelector(
                selectOrderFeatureState,
                state => state.orders,
            Severity: Major
            Found in libs/order/state/src/selectors/order-entities.selector.ts - About 5 hrs to fix

              Function createConfigurableProductSelectors has 126 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const createConfigurableProductSelectors = <T extends DaffProduct = DaffProduct>(): DaffConfigurableProductMemoizedSelectors<T> => {
              
                const {
                  selectConfigurableProductAppliedAttributes,
                } = getDaffConfigurableProductEntitiesSelectors<T>();

                File index.js has 334 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module.exports = {
                  plugins: [
                    'modules-newlines',
                    'jasmine',
                    "eslint-plugin-import",
                Severity: Minor
                Found in tools/eslint/config/index.js - About 4 hrs to fix

                  Function createCompositeProductSelectors has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const createCompositeProductSelectors = <T extends DaffProduct>(): DaffCompositeProductMemoizedSelectors<T> => {
                  
                    const {
                      selectProduct,
                    } = getDaffProductEntitiesSelectors<T>();

                  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

                  Function createCompositeProductSelectors has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const createCompositeProductSelectors = <T extends DaffProduct>(): DaffCompositeProductMemoizedSelectors<T> => {
                  
                    const {
                      selectProduct,
                    } = getDaffProductEntitiesSelectors<T>();

                    Function createCartItemEntitiesSelectors has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const createCartItemEntitiesSelectors = <
                      T extends DaffCart = DaffCart,
                      V extends DaffCartOrderResult = DaffCartOrderResult,
                      Configurable extends DaffConfigurableCartItem = DaffConfigurableCartItem,
                      Composite extends DaffCompositeCartItem = DaffCompositeCartItem,

                      Function cartItemReducer has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Function createProductEntitiesSelectors has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const createProductEntitiesSelectors = <T extends DaffProduct>(): DaffProductEntitiesMemoizedSelectors<T> => {
                          const {
                            selectProductState,
                          } = getDaffProductFeatureSelector<T>();
                          const adapterSelectors = daffProductEntitiesAdapter<T>().getSelectors();

                          Function daffCollectionSelectorFactory has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const daffCollectionSelectorFactory = <
                            TState,
                            TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata
                          >(
                            selectCollectionState: MemoizedSelector<TState, TMetadata>,
                          Severity: Major
                          Found in libs/core/state/src/collection/selector-factory.ts - About 2 hrs to fix

                            Function cartPaymentReducer has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              File order.ts has 269 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/order/driver/magento/2-4-1/src/transforms/responses/order.ts - About 2 hrs to fix

                                Function createConfigurableProductSelectors has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const createConfigurableProductSelectors = <T extends DaffProduct = DaffProduct>(): DaffConfigurableProductMemoizedSelectors<T> => {
                                
                                  const {
                                    selectConfigurableProductAppliedAttributes,
                                  } = getDaffConfigurableProductEntitiesSelectors<T>();

                                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

                                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';

                                  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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language