Showing 120 of 122 total issues
File cart.facade.ts
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
Inject,
Injectable,
} from '@angular/core';
import { Dictionary } from '@ngrx/entity';
File order.ts
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
daffAdd,
daffSubtract,
} from '@daffodil/core';
import { MagentoDiscount } from '@daffodil/driver/magento';
Function daffCustomerAddressEntitiesReducer
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function daffCustomerAddressEntitiesReducer<
T extends DaffCustomerAddress = DaffCustomerAddress,
>(
state = daffCustomerAddressEntitiesAdapter<T>().getInitialState(),
action: DaffCustomerAddressActions<T> | DaffCustomerActions): DaffOperationEntityState<T> {
Function constructor
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(private store: Store<DaffOrderStateRootSlice<T>>) {
const {
selectOrderIds,
selectOrderEntities,
selectOrders,
Function createCompositeProductAppliedOptionsEntitiesSelectors
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const createCompositeProductAppliedOptionsEntitiesSelectors = <T extends DaffProduct>(): DaffCompositeProductEntitiesMemoizedSelectors<T> => {
const {
selectCompositeProductState,
} = getDaffCompositeProductFeatureSelector();
const {
Function daffCustomerPaymentEntitiesReducer
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function daffCustomerPaymentEntitiesReducer<
TPayment extends DaffCustomerPayment = DaffCustomerPayment,
TRequest extends DaffCustomerPaymentRequest = DaffCustomerPaymentRequest,
>(
state = daffCustomerPaymentEntitiesAdapter<TPayment>().getInitialState(),
Function transformCartTotals
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function transformCartTotals(cart: Partial<MagentoCart>): {totals: DaffCart['totals']} {
const totalTax = cart.prices.applied_taxes ? cart.prices.applied_taxes.reduce((acc, tax) => (daffAdd(acc, tax.amount.value)), 0) : 0;
return {
totals: {
[DaffCartTotalTypeEnum.grandTotal]: {
Function cartReducer
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function cartReducer<T extends DaffCart = DaffCart>(
state = daffCartReducerInitialState,
action: ActionTypes<T>,
): DaffCartReducerState<T> {
switch (action.type) {
Function search
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
search(query: string, options: DaffSearchProductDriverOptions = {}): Observable<DaffSearchProductDriverResponse> {
const queryVariables = this.getVariables(options);
return combineLatest([
this.apollo.query<MagentoSearchForProductsResponse>({
Function forRoot
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static forRoot(): ModuleWithProviders<DaffTestingCartDriverModule> {
return {
ngModule: DaffTestingCartDriverModule,
providers: [
{
Function forRoot
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static forRoot(): ModuleWithProviders<DaffCartInMemoryDriverModule> {
return {
ngModule: DaffCartInMemoryDriverModule,
providers: [
{
Function cartCouponReducer
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function cartCouponReducer<T extends DaffCart = DaffCart>(
state = daffCartReducerInitialState,
action: ActionTypes<T>,
): DaffCartReducerState<T> {
switch (action.type) {
Function createCategorySelectors
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const createCategorySelectors = <V extends DaffGenericCategory<V>, W extends DaffProduct>(): DaffCategoryMemoizedSelectors<V, W> => {
const { selectAllProducts,selectProductEntities } = getDaffProductSelectors<W>();
const {
selectCategoryEntities,
Function createCartOrderSelectors
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const createCartOrderSelectors = <
T extends DaffCart = DaffCart,
V extends DaffCartOrderResult = DaffCartOrderResult,
>(): DaffCartOrderMemoizedSelectors<T, V> => {
const selectCartFeatureState = getDaffCartFeatureSelector<T, V>().selectCartFeatureState;
Function slideAnimation
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
get slideAnimation(): any {
switch (this.toastPosition.config.horizontal + '-' + this.toastPosition.config.vertical) {
case 'left-top':
case 'left-bottom':
return {
Function daffCartInMemoryComputeCartTotals
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function daffCartInMemoryComputeCartTotals(cart: DaffCart, products: DaffProduct[]): DaffCart {
const shipping = cart.shipping_information ? faker.datatype.number({ min: 0, max: 99 }) : 0;
const subtotalExcludingTax = cart.items?.reduce((acc, { product_id }) =>
acc + (products.find(({ id }) => id === product_id)?.price || 0),
0,
Function daffCartOrderReducer
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function daffCartOrderReducer<T extends DaffCartOrderResult = DaffCartOrderResult>(
state = daffCartOrderInitialState,
action: ActionTypes<
DaffCart,
DaffCartItemInput,
Function daffCategoryPageMetadataReducer
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function daffCategoryPageMetadataReducer<U extends DaffGenericCategory<U>, W extends DaffProduct>(
state = daffCategoryPageMetadataInitialState,
action: DaffCategoryActions<U, W> | DaffCategoryPageActions<U, W> | DaffCategoryPageProductCollectionActions,
): DaffCategoryPageMetadataReducerState {
const adapter = getCollectionStateAdapter<DaffCategoryPageMetadataReducerState>();
Function daffCartStoreCreditCartReducer
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function daffCartStoreCreditCartReducer<T extends DaffCartWithStoreCredit = DaffCartWithStoreCredit>(
state = daffCartReducerInitialState,
action: DaffCartStoreCreditActions,
): DaffCartReducerState<T> {
switch (action.type) {
Function daffAuthReducer
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function daffAuthReducer(
state = daffAuthInitialState,
action: DaffAuthActions | DaffAuthLoginActions | DaffAuthRegisterSuccess | DaffAuthResetPasswordActions,
): DaffAuthReducerState {
switch (action.type) {