graycoreio/daffodil

View on GitHub

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

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

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

                        export function
                        daffColorMixin<T extends Constructor<HasElementRef>>(Base: T, defaultColor?: DaffPalette) {
                          class DaffColorableMixinClass extends Base {
                            //TODO move this back to private in Typescript 3.1
                            _color: DaffPalette;
                        Severity: Minor
                        Found in libs/design/src/core/colorable/colorable-mixin.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 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(config: DaffCategoryMagentoDriverConfig = MAGENTO_CATEGORY_CONFIG_DEFAULT): ModuleWithProviders<DaffCategoryMagentoDriverModule> {
                              return {
                                ngModule: DaffCategoryMagentoDriverModule,
                                providers: [
                                  {
                          Severity: Minor
                          Found in libs/category/driver/magento/src/category-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 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

                                    Function transformTotals has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function transformTotals(totals: {
                                      grand_total: number;
                                      subtotal: number;
                                      shipping: number;
                                      discount: number;
                                    Severity: Minor
                                    Found in libs/order/driver/magento/2-4-0/src/transforms/responses/order.ts - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language