SUSE/stratos

View on GitHub

Showing 1,395 of 1,395 total issues

AppAutoscalerComboChartComponent has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

@Component({
  selector: 'app-autoscaler-combo-chart-component',
  templateUrl: './combo-chart.component.html',
  styleUrls: ['./combo-chart.component.scss'],
  encapsulation: ViewEncapsulation.None

    Function setProps has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      setProps(props: KubernetesResourceViewerConfig) {
        this.title = props.title;
        this.analysis = props.analysis;
        this.component = props.component;
    
    

      Function cfUsersRolesReducer has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function cfUsersRolesReducer(state: UsersRolesState = defaultState, action: Action): UsersRolesState {
        switch (action.type) {
          case UsersRolesActions.SetUsers:
            const setUsersAction = action as UsersRolesSetUsers;
            const orgGuid = state.newRoles ? state.newRoles.orgGuid : '';

        Method KubeTerminal.createPod has 98 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (k *KubeTerminal) createPod(c echo.Context, kubeConfig, kubeVersion string, ws *websocket.Conn) (*PodCreationData, error) {
            // Unique ID for the secret and pod name
            id := uuid.NewV4().String()
            id = strings.ReplaceAll(id, "-", "")
            // Names for the secret and pod
        Severity: Major
        Found in src/jetstream/plugins/kubernetes/terminal/helpers.go - About 2 hrs to fix

          Function bars has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.bars = this.series.map((d, index) => {
          
                let value = d.value;
                const label = d.name;
                const formattedLabel = formatLabel(label);

            Method portalProxy.xsrfMiddlewareWithConfig has a Cognitive Complexity of 24 (exceeds 8 allowed). Consider refactoring.
            Open

            func (p *portalProxy) xsrfMiddlewareWithConfig(config MiddlewareConfig) echo.MiddlewareFunc {
                // Default skipper function always returns false
                if config.Skipper == nil {
                    config.Skipper = func(c echo.Context) bool { return false }
                }
            Severity: Minor
            Found in src/jetstream/middleware.go - About 2 hrs to fix

            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 setupForGit has a Cognitive Complexity of 24 (exceeds 8 allowed). Consider refactoring.
            Open

              private setupForGit() {
                this.projectInfo$ = this.store.select(selectProjectExists).pipe(
                  filter(p => !!p),
                  map(p => (!!p.exists && !!p.data) ? p.data : null),
                  tap(p => {

            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 isNewer has a Cognitive Complexity of 24 (exceeds 8 allowed). Consider refactoring.
            Open

              public isNewer(other: Version): boolean {
                if (!this.valid || !other.valid) {
                  return false;
                }
            
            

            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 application-delete.component.ts has 288 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { DatePipe } from '@angular/common';
            import { Component } from '@angular/core';
            import { Store } from '@ngrx/store';
            import { combineLatest, Observable, ReplaySubject } from 'rxjs';
            import { filter, first, map, pairwise, shareReplay, startWith, switchMap, tap } from 'rxjs/operators';

              File space.actions.ts has 287 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { HttpParams, HttpRequest } from '@angular/common/http';
              
              import { getActions } from '../../../store/src/actions/action.helper';
              import { PaginatedAction } from '../../../store/src/types/pagination.types';
              import { ICFAction } from '../../../store/src/types/request.types';
              Severity: Minor
              Found in src/frontend/packages/cloud-foundry/src/actions/space.actions.ts - About 2 hrs to fix

                Function row has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  @Input('row')
                  set row(row: APIResource<IServiceInstance>) {
                    super.row = row;
                    if (row) {
                      this.serviceInstanceEntity = row;

                  Function setupOrgLevelTest has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function setupOrgLevelTest(selectAddRemove: (rb: RadioGroup) => void, checkInitialState: () => void, checkFinishingState: () => void) {
                        it('Check initial state and get to stepper', () => {
                          checkInitialState();
                  
                          orgPage.subHeader.hasIconButton('people');

                    Function processArray has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function processArray(array, output?, nested?: boolean) {
                      let format;
                      let oneOf;
                      let type;
                    
                    

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

                        constructor(
                          public applicationService: ApplicationService,
                          private store: Store<CFAppState>,
                          private endpointsService: EndpointsService,
                          private ngZone: NgZone,

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

                          private getBreadcrumbs(
                            application: IApp,
                            endpoint: EndpointModel,
                            org: APIResource<IOrganization>,
                            space: APIResource<ISpace>

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

                            constructor(
                              private componentFactoryResolver: ComponentFactoryResolver,
                              public helmReleaseHelper: HelmReleaseHelperService,
                              private store: Store<AppState>,
                              private confirmDialog: ConfirmationDialogService,

                            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));
                            
                            

                              SpecifyDetailsStepComponent has 25 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              @Component({
                                selector: 'app-specify-details-step',
                                templateUrl: './specify-details-step.component.html',
                                styleUrls: ['./specify-details-step.component.scss'],
                              })

                                Method KubeTerminal.Start has 95 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func (k *KubeTerminal) Start(c echo.Context) error {
                                    log.Debug("Kube Terminal start request")
                                
                                    endpointGUID := c.Param("guid")
                                    userGUID := c.Get("user_id").(string)
                                Severity: Major
                                Found in src/jetstream/plugins/kubernetes/terminal/start.go - About 2 hrs to fix

                                  Function setupDetailsStep has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    private setupDetailsStep() {
                                      this.details = new FormGroup({
                                        endpoint: new FormControl('', Validators.required),
                                        releaseName: new FormControl('', Validators.required),
                                        releaseNamespace: new FormControl('', Validators.required),
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language