Showing 122 of 124 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 429 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createCartSelectors = <
T extends DaffCart = DaffCart,
V extends DaffCartOrderResult = DaffCartOrderResult,
U extends DaffStatefulCartItem = DaffStatefulCartItem
>(): DaffCartStateMemoizedSelectors<T, V, U> => {
File cart.selector.ts
has 547 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
createSelector,
MemoizedSelector,
DefaultProjectorFn,
} from '@ngrx/store';
File test-data.service.ts
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Injectable } from '@angular/core';
import {
DaffOrder,
DaffOrderAddress,
Function constructor
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
private store: Store<DaffCartStateRootSlice<T, V, U>>,
// typing this as `Record<string, any>` or `object` fails the build
// because Angular explicitly types this as `Object`
// eslint-disable-next-line @typescript-eslint/ban-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 cart.facade.ts
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
Inject,
Injectable,
} from '@angular/core';
import { Dictionary } from '@ngrx/entity';
Function createCartItemEntitiesSelectors
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createCartItemEntitiesSelectors = <
T extends DaffCart = DaffCart,
V extends DaffCartOrderResult = DaffCartOrderResult,
U extends DaffStatefulCartItem = DaffStatefulCartItem
>(): DaffCartItemEntitiesMemoizedSelectors<T, V, U> => {
File index.js
has 323 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 createCartSelectors
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
const createCartSelectors = <
T extends DaffCart = DaffCart,
V extends DaffCartOrderResult = DaffCartOrderResult,
U extends DaffStatefulCartItem = DaffStatefulCartItem
>(): DaffCartStateMemoizedSelectors<T, V, U> => {
- 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 cartItemReducer
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function cartItemReducer<T extends DaffCart>(
state = daffCartReducerInitialState,
action: ActionTypes,
): DaffCartReducerState<T> {
switch (action.type) {
Function daffCreateOperationEntityStateAdapter
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function daffCreateOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable>(adapter: EntityAdapter<DaffOperationEntity<T>> = createEntityAdapter<DaffOperationEntity<T>>()): DaffOperationEntityStateAdapter<T> {
return {
list: (entities, state) => adapter.setAll(
entities.map<DaffOperationEntity<T>>(entity => ({
...entity,
Function ngAfterContentChecked
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
ngAfterContentChecked() {
const nextShift = sidebarViewportContentShift(this.sidebars) + 'px';
if (this._shift !== nextShift) {
this._shift = nextShift;
- 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 forRoot
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
static forRoot(): ModuleWithProviders<DaffCartMagentoDriverModule> {
return {
ngModule: DaffCartMagentoDriverModule,
providers: [
{
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 daffCollectionSelectorFactory
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const daffCollectionSelectorFactory = <
TState,
TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata
>(
selectCollectionState: MemoizedSelector<TState, TMetadata>,