graycoreio/daffodil

View on GitHub

Showing 119 of 121 total issues

Function cartShippingAddressReducer has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function cartShippingAddressReducer<T extends DaffCart>(
  state = daffCartReducerInitialState,
  action: ActionTypes,
): DaffCartReducerState<T> {
  switch (action.type) {

    Function cartBillingAddressReducer has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function cartBillingAddressReducer<T extends DaffCart = DaffCart>(
      state = daffCartReducerInitialState,
      action: ActionTypes<T>,
    ): DaffCartReducerState<T> {
      switch (action.type) {

      Function cartShippingInformationReducer has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function cartShippingInformationReducer<T extends DaffCart = DaffCart>(
        state = daffCartReducerInitialState,
        action: ActionTypes<T>,
      ): DaffCartReducerState<T> {
        switch (action.type) {

        Function daffCartItemEntitiesReducer has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function daffCartItemEntitiesReducer<
          T extends DaffCart = DaffCart,
          U extends DaffCartItemInput = DaffCartItemInput,
        >(
          state = daffCartItemEntitiesAdapter<T['items'][number]>().getInitialState(),

          Function sortTrie has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          export const sortTrie = <T extends Trie>(trie: T, sortData: TrieSortData, parent = ''): T => {
            const path = parent && trie.id ? `${parent}/${trie.id}` : trie.id || parent;
            const sort = sortData[path];
          
            trie.children = trie.children
          Severity: Minor
          Found in tools/dgeni/src/utils/trie-sort.ts - About 1 hr 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 createCompositeProductAppliedOptionsEntitiesSelectors has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

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

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

            constructor(
              private cartFacade: DaffCartFacade,
            ) {
              this.currentStep$ = combineLatest([
                this._currentStep$,
          Severity: Minor
          Found in apps/demo/src/app/checkout/step/step.service.ts - About 1 hr to fix

            Function createConfigurableProductAppliedAttributesEntitiesSelectors has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const createConfigurableProductAppliedAttributesEntitiesSelectors = <T extends DaffProduct>(): DaffConfigurableProductEntitiesMemoizedSelectors<T> => {
              const {
                selectConfigurableProductState,
              } = getDaffConfigurableProductFeatureSelector();
              const adapterSelectors = daffConfigurableProductAppliedAttributesEntitiesAdapter().getSelectors();

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

                constructor(
                  private productFactory: DaffProductExtensionFactory,
                  private productImageFactory: DaffProductImageFactory) {
                  this._products = [
                    '1001',
              Severity: Minor
              Found in libs/product/driver/in-memory/src/backend/product.service.ts - About 1 hr to fix

                Function fakeTree has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  private fakeTree(depth: number = 0): DaffNavigationTree {
                    const children = depth !== 0
                      ? [...Array(faker.datatype.number({ min:1, max:3 }))].map(() => this.fakeTree(depth - 1))
                      : [];
                
                
                Severity: Minor
                Found in libs/navigation/testing/src/factories/navigation-tree.factory.ts - About 1 hr to fix

                  Function createProductReviewEntitiesSelectors has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const createProductReviewEntitiesSelectors = <T extends DaffProductReview = DaffProductReview>(): DaffProductReviewEntitiesMemoizedSelectors<T> => {
                    const {
                      selectReviewsState,
                    } = getDaffReviewsFeatureSelector<T>();
                    const adapterSelectors = daffProductReviewEntitiesAdapter<T>().getSelectors();

                    Function daffAuthorizeNetReducer has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function daffAuthorizeNetReducer <T extends DaffAuthorizeNetTokenRequest>(
                      state: DaffAuthorizeNetReducerState = daffAuthorizeNetReducerInitialState,
                      action: DaffAuthorizeNetActions<T> | DaffPaymentActions,
                    ): DaffAuthorizeNetReducerState {
                      switch (action.type) {

                      Function daffMagentoCustomerOrderTransformItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function daffMagentoCustomerOrderTransformItem(item: MagentoOrderItem, order: MagentoCustomerOrder, qty: number): DaffOrderItem {
                        const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);
                        const rowTotal = qty * item.product_sale_price.value;
                        const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);
                      
                      

                        Function open has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          open(
                            toast: DaffToastData,
                            configuration?: Partial<DaffToastConfiguration>,
                          ): DaffToast {
                            if(this._parentToast && this.options.useParent) {
                        Severity: Minor
                        Found in libs/design/toast/src/service/toast.service.ts - About 1 hr to fix

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

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

                            Function daffMagentoCustomerOrderTransformItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function daffMagentoCustomerOrderTransformItem(item: MagentoOrderItem, order: MagentoCustomerOrder, qty: number): DaffOrderItem {
                              const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);
                              const rowTotal = qty * item.product_sale_price.value;
                              const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);
                            
                            

                              Function daffMagentoTransformItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function daffMagentoTransformItem(item: MagentoOrderItem, order: MagentoOrder, qty: number): DaffOrderItem {
                                const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);
                                const rowTotal = qty * item.product_sale_price.value;
                                const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);
                              
                              
                              Severity: Minor
                              Found in libs/order/driver/magento/2-4-1/src/transforms/responses/order.ts - About 1 hr to fix

                                Function listOrders has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  private listOrders(reqInfo: RequestInfo) {
                                    const request: DaffCollectionRequest | null = reqInfo.utils.getJsonBody(reqInfo.req);
                                    const pageSize = request?.pageSize || DEFAULT_PAGE_SIZE;
                                    const currentPage = request?.currentPage || 1;
                                    const orders: DaffOrder[] = reqInfo.collection;
                                Severity: Minor
                                Found in libs/order/driver/in-memory/src/backend/order.service.ts - About 1 hr to fix

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

                                    constructor(
                                      injector: Injector,
                                      private componentFactoryResolver: ComponentFactoryResolver,
                                    ) {
                                      [
                                  Severity: Minor
                                  Found in apps/design-land/src/app/app.component.ts - About 1 hr to fix

                                    Function createProductPageSelectors has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const createProductPageSelectors = <T extends DaffProductReview = DaffProductReview>(): DaffProductPageReviewsMemoizedSelectors => {
                                    
                                      const {
                                        selectReviewsState,
                                      } = getDaffReviewsFeatureSelector<T>();
                                    Severity: Minor
                                    Found in libs/reviews/state/src/selectors/product-reviews/selectors.ts - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language