graycoreio/daffodil

View on GitHub

Showing 122 of 124 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 429 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const createCartSelectors = <
      T extends DaffCart = DaffCart,
      V extends DaffCartOrderResult = DaffCartOrderResult,
      U extends DaffStatefulCartItem = DaffStatefulCartItem
    >(): DaffCartStateMemoizedSelectors<T, V, U> => {
    Severity: Major
    Found in libs/cart/state/src/selectors/cart/cart.selector.ts - About 2 days to fix

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

      import {
        createSelector,
        MemoizedSelector,
        DefaultProjectorFn,
      } from '@ngrx/store';
      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

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

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

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

                  const createCartItemEntitiesSelectors = <
                    T extends DaffCart = DaffCart,
                    V extends DaffCartOrderResult = DaffCartOrderResult,
                    U extends DaffStatefulCartItem = DaffStatefulCartItem
                  >(): DaffCartItemEntitiesMemoizedSelectors<T, V, U> => {

                    File index.js has 323 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 3 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 createCartSelectors has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const createCartSelectors = <
                          T extends DaffCart = DaffCart,
                          V extends DaffCartOrderResult = DaffCartOrderResult,
                          U extends DaffStatefulCartItem = DaffStatefulCartItem
                        >(): DaffCartStateMemoizedSelectors<T, V, U> => {
                        Severity: Minor
                        Found in libs/cart/state/src/selectors/cart/cart.selector.ts - About 3 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 cartItemReducer has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function cartItemReducer<T extends DaffCart>(
                          state = daffCartReducerInitialState,
                          action: ActionTypes,
                        ): 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 daffCreateOperationEntityStateAdapter has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function daffCreateOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable>(adapter: EntityAdapter<DaffOperationEntity<T>> = createEntityAdapter<DaffOperationEntity<T>>()): DaffOperationEntityStateAdapter<T> {
                            return {
                              list: (entities, state) => adapter.setAll(
                                entities.map<DaffOperationEntity<T>>(entity => ({
                                  ...entity,
                          Severity: Major
                          Found in libs/core/state/src/operation/entity/adapter.ts - About 3 hrs to fix

                            Function ngAfterContentChecked has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                            Open

                              ngAfterContentChecked() {
                                const nextShift = sidebarViewportContentShift(this.sidebars) + 'px';
                                if (this._shift !== nextShift) {
                                  this._shift = nextShift;
                            
                            

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

                              static forRoot(): ModuleWithProviders<DaffCartMagentoDriverModule> {
                                return {
                                  ngModule: DaffCartMagentoDriverModule,
                                  providers: [
                                    {
                            Severity: Major
                            Found in libs/cart/driver/magento/src/cart-driver.module.ts - About 2 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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language