Showing 38 of 62 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export function store(options: StoreSchema): Rule {
return (host: Tree) => {
if (isEmpty(options.name)) {
throw new SchematicsException('Invalid options, "name" is required.');
}
Severity: Major
Found in packages/store/schematics/src/store/store.factory.ts and 1 other location - About 7 hrs to fix
packages/store/schematics/src/state/state.factory.ts on lines 10..34

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export function state(options: StateSchema): Rule {
return (host: Tree) => {
if (isEmpty(options.name)) {
throw new SchematicsException('Invalid options, "name" is required.');
}
Severity: Major
Found in packages/store/schematics/src/state/state.factory.ts and 1 other location - About 7 hrs to fix
packages/store/schematics/src/store/store.factory.ts on lines 10..34

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export function ofActionCanceled<T extends ActionType[]>(
...allowedTypes: T
): OperatorFunction<
ActionContext<Constructed<T[TupleKeys<T>]>>,
Constructed<T[TupleKeys<T>]>
Severity: Major
Found in packages/store/src/operators/of-action.ts and 2 other locations - About 3 hrs to fix
packages/store/src/operators/of-action.ts on lines 46..53
packages/store/src/operators/of-action.ts on lines 60..67

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export function ofActionDispatched<T extends ActionType[]>(
...allowedTypes: T
): OperatorFunction<
ActionContext<Constructed<T[TupleKeys<T>]>>,
Constructed<T[TupleKeys<T>]>
Severity: Major
Found in packages/store/src/operators/of-action.ts and 2 other locations - About 3 hrs to fix
packages/store/src/operators/of-action.ts on lines 60..67
packages/store/src/operators/of-action.ts on lines 74..81

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export function ofActionSuccessful<T extends ActionType[]>(
...allowedTypes: T
): OperatorFunction<
ActionContext<Constructed<T[TupleKeys<T>]>>,
Constructed<T[TupleKeys<T>]>
Severity: Major
Found in packages/store/src/operators/of-action.ts and 2 other locations - About 3 hrs to fix
packages/store/src/operators/of-action.ts on lines 46..53
packages/store/src/operators/of-action.ts on lines 74..81

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export class NgxsReduxDevtoolsPluginModule {
static forRoot(
options?: NgxsDevtoolsOptions
): ModuleWithProviders<NgxsReduxDevtoolsPluginModule> {
return {
Severity: Major
Found in packages/devtools-plugin/src/devtools.module.ts and 1 other location - About 2 hrs to fix
packages/logger-plugin/src/logger.module.ts on lines 30..50

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export class NgxsLoggerPluginModule {
static forRoot(
options?: NgxsLoggerPluginOptions
): ModuleWithProviders<NgxsLoggerPluginModule> {
return {
Severity: Major
Found in packages/logger-plugin/src/logger.module.ts and 1 other location - About 2 hrs to fix
packages/devtools-plugin/src/devtools.module.ts on lines 23..43

File state-factory.ts has 279 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { DestroyRef, Injectable, Injector, inject, ɵisPromise } from '@angular/core';
import {
ɵmemoize,
ɵMETA_KEY,
ɵPlainObjectOf,
Severity: Minor
Found in packages/store/src/internal/state-factory.ts - About 2 hrs to fix

    Function handle has 88 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    handle(state: any, event: any, next: NgxsNextPluginFn) {
    if (typeof ngServerMode !== 'undefined' && ngServerMode) {
    return next(state, event);
    }
     
     
    Severity: Major
    Found in packages/storage-plugin/src/storage.plugin.ts - About 2 hrs to fix

      Function ngOnInit has 78 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      ngOnInit() {
      const resetForm$ = this._actions$.pipe(
      ofActionDispatched(ResetForm),
      takeUntilDestroyed(this._destroyRef)
      );
      Severity: Major
      Found in packages/form-plugin/src/directive.ts - About 2 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export class RouterCancel<T, V = RouterStateSnapshot> {
        static readonly type = '[Router] RouterCancel';
         
        constructor(
        public routerState: V,
        Severity: Major
        Found in packages/router-plugin/src/router.actions.ts and 1 other location - About 2 hrs to fix
        packages/router-plugin/src/router.actions.ts on lines 77..86

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export class RouterError<T, V = RouterStateSnapshot> {
        static readonly type = '[Router] RouterError';
         
        constructor(
        public routerState: V,
        Severity: Major
        Found in packages/router-plugin/src/router.actions.ts and 1 other location - About 2 hrs to fix
        packages/router-plugin/src/router.actions.ts on lines 63..72

        Function handle has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
        Open

        handle(state: any, event: any, next: NgxsNextPluginFn) {
        if (typeof ngServerMode !== 'undefined' && ngServerMode) {
        return next(state, event);
        }
         
         
        Severity: Minor
        Found in packages/storage-plugin/src/storage.plugin.ts - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export interface StateSchema {
        /**
        * The name of the state.
        */
        name: string;
        Severity: Major
        Found in packages/store/schematics/src/state/state.schema.d.ts and 1 other location - About 1 hr to fix
        packages/store/schematics/src/store/store.schema.d.ts on lines 1..26

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export interface StoreSchema {
        /**
        * The name of the store.
        */
        name: string;
        Severity: Major
        Found in packages/store/schematics/src/store/store.schema.d.ts and 1 other location - About 1 hr to fix
        packages/store/schematics/src/state/state.schema.d.ts on lines 1..26

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export const SESSION_STORAGE_ENGINE = /* @__PURE__ */ new InjectionToken<StorageEngine | null>(
        typeof ngDevMode !== 'undefined' && ngDevMode ? 'SESSION_STORAGE_ENGINE' : '',
        {
        providedIn: 'root',
        factory: () =>
        Severity: Major
        Found in packages/storage-plugin/src/engines.ts and 1 other location - About 1 hr to fix
        packages/storage-plugin/src/engines.ts on lines 7..13

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export const LOCAL_STORAGE_ENGINE = /* @__PURE__ */ new InjectionToken<StorageEngine | null>(
        typeof ngDevMode !== 'undefined' && ngDevMode ? 'LOCAL_STORAGE_ENGINE' : '',
        {
        providedIn: 'root',
        factory: () => (typeof ngServerMode !== 'undefined' && ngServerMode ? null : localStorage)
        Severity: Major
        Found in packages/storage-plugin/src/engines.ts and 1 other location - About 1 hr to fix
        packages/storage-plugin/src/engines.ts on lines 15..22

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export function withNgxsReduxDevtoolsPlugin(
        options?: NgxsDevtoolsOptions
        ): EnvironmentProviders {
        return makeEnvironmentProviders([
        withNgxsPlugin(NgxsReduxDevtoolsPlugin),
        Severity: Major
        Found in packages/devtools-plugin/src/devtools.module.ts and 1 other location - About 1 hr to fix
        packages/logger-plugin/src/logger.module.ts on lines 52..62

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export function withNgxsLoggerPlugin(options?: NgxsLoggerPluginOptions): EnvironmentProviders {
        return makeEnvironmentProviders([
        withNgxsPlugin(NgxsLoggerPlugin),
        { provide: USER_OPTIONS, useValue: options },
        {
        Severity: Major
        Found in packages/logger-plugin/src/logger.module.ts and 1 other location - About 1 hr to fix
        packages/devtools-plugin/src/devtools.module.ts on lines 45..60

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        export class RouterNavigation<T = RouterStateSnapshot> {
        static readonly type = '[Router] RouterNavigation';
         
        constructor(
        public routerState: T,
        Severity: Major
        Found in packages/router-plugin/src/router.actions.ts and 2 other locations - About 1 hr to fix
        packages/router-plugin/src/router.actions.ts on lines 91..99
        packages/router-plugin/src/router.actions.ts on lines 104..112
        Severity
        Category
        Status
        Source
        Language