graycoreio/daffodil

View on GitHub

Showing 159 of 161 total issues

Function create has 463 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 534 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 421 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

            File role.ts has 396 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { Document } from 'dgeni';
            import { ClassExportDoc } from 'dgeni-packages/typescript/api-doc-types/ClassExportDoc';
            import type { ClassLikeExportDoc } from 'dgeni-packages/typescript/api-doc-types/ClassLikeExportDoc';
            import type { ConstExportDoc } from 'dgeni-packages/typescript/api-doc-types/ConstExportDoc';
            import type { FunctionExportDoc } from 'dgeni-packages/typescript/api-doc-types/FunctionExportDoc';
            Severity: Minor
            Found in tools/dgeni/src/transforms/daffodil-api-package/processors/role.ts - About 5 hrs to fix

              Function createOrderEntitySelectors has a Cognitive Complexity of 34 (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

              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>();

                Function createOrderEntitySelectors has 117 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 4 hrs to fix

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

                  module.exports = {
                  plugins: [
                  'modules-newlines',
                  'jasmine',
                  'jest',
                  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>();

                    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 daffDocsGetRoleFromTsDoc has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const daffDocsGetRoleFromTsDoc = (doc: DaffDocsTsDocument): DaffDocsApiRole => {
                      switch (doc.docType) {
                      case DaffDocsApiType.CLASS:
                      if (doc.decorators?.find(({ name }) => name === 'Component')) {
                      return DaffDocsApiRole.COMPONENT;
                      Severity: Minor
                      Found in libs/docs-utils/src/api/role/get-from-ts-doc.ts - About 3 hrs to fix

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

                          addFields(doc: SerializableDoc & DaffApiDoc & DaffDocsTsDocument): SerializableDoc & DaffApiDoc {
                          switch (doc.role) {
                          case DaffDocsApiRole.COMPONENT:
                          this.directive(<any>doc);
                          return doc;
                          Severity: Major
                          Found in tools/dgeni/src/transforms/daffodil-api-package/processors/role.ts - About 2 hrs to fix

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

                                  Function getBreadcrumbs has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  private getBreadcrumbs(doc: ParentedDocument & KindedDocument): Array<DaffBreadcrumb> {
                                  const segments = (<string>doc.path).split('/');
                                  const breadcrumbs = segments
                                  .map((segment, i) => getStaticBreadcrumb(segment, segments.slice(0, i).join('/')))
                                  .filter((b, i, ary) => !!b && ary.findIndex((e) => e?.label === b.label) === i);
                                  Severity: Major
                                  Found in tools/dgeni/src/processors/breadcrumb.ts - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language