SUSE/stratos

View on GitHub
src/frontend/packages/kubernetes/src/kubernetes/store/kubernetes.effects.ts

Summary

Maintainability
D
2 days
Test Coverage

File kubernetes.effects.ts has 500 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { Action, Store } from '@ngrx/store';
import { ClearPaginationOfEntity, ClearPaginationOfType } from 'frontend/packages/store/src/actions/pagination.actions';

    Function processListAction has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private processListAction<T extends BasicKubeAPIResource>(
        action: KubePaginationAction,
        url: string) {
        this.store.dispatch(new StartRequestAction(action));
    
    

      KubernetesEffects has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      @Injectable()
      export class KubernetesEffects {
        proxyAPIVersion = environment.proxyAPIVersion;
      
        constructor(private http: HttpClient, private actions$: Actions, private store: Store<AppState>) { }

        Function processSingleItemAction has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private processSingleItemAction<T extends BasicKubeAPIResource>(
            action: KubeAction,
            url: string,
            body?: any) {
            const requestType: ApiRequestTypes = body ? 'create' : 'fetch';

          Function processSingleItemDeleteAction has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            private processSingleItemDeleteAction<T extends BasicKubeAPIResource>(action: KubeAction, url: string) {
              this.store.dispatch(new StartRequestAction(action, 'delete'));
              const headers = new HttpHeaders({
                'x-cap-cnsi-list': action.kubeGuid,
                'x-cap-passthrough': 'true'

            There are no issues that match your filters.

            Category
            Status