Showing 119 of 121 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();
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;
File test-data.service.ts
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Injectable } from '@angular/core';
import {
DaffOrder,
DaffOrderAddress,
File cart.selector.ts
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
createSelector,
MemoizedSelector,
DefaultProjectorFn,
} from '@ngrx/store';
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
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,
- Read upRead up
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,
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 index.js
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = {
plugins: [
'modules-newlines',
'jasmine',
"eslint-plugin-import",
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>();
- Read upRead up
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 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) {
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>,
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) {
File order.ts
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
daffAdd,
daffSubtract,
} from '@daffodil/core';
import { MagentoDiscount } from '@daffodil/driver/magento';
Function createConfigurableProductSelectors
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const createConfigurableProductSelectors = <T extends DaffProduct = DaffProduct>(): DaffConfigurableProductMemoizedSelectors<T> => {
const {
selectConfigurableProductAppliedAttributes,
} = getDaffConfigurableProductEntitiesSelectors<T>();
- Read upRead up
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
File cart.facade.ts
has 266 lines of code (exceeds 250 allowed). Consider refactoring. 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
import {
daffAdd,
daffSubtract,
} from '@daffodil/core';
import { MagentoDiscount } from '@daffodil/driver/magento';