SUSE/stratos

View on GitHub

Showing 885 of 1,395 total issues

File quota-definitions.actions.ts has 336 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { HttpParams, HttpRequest } from '@angular/common/http';

import { PaginatedAction } from '../../../store/src/types/pagination.types';
import { ICFAction } from '../../../store/src/types/request.types';
import { IQuotaDefinition } from '../cf-api.types';

    CfTopLevelPage has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class CfTopLevelPage extends CFPage {
    
      private readonly until = protractor.ExpectedConditions;
    
      constructor() {
    Severity: Minor
    Found in src/test-e2e/cloud-foundry/cf-level/cf-top-level-page.po.ts - About 4 hrs to fix

      Function ngOnInit has 100 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        ngOnInit() {
          this.cardTwoFetching$ = this.applicationService.application$.pipe(
            combineLatest(
              this.applicationService.appSummary$
            ),

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

          constructor(
            public activatedRoute: ActivatedRoute,
            public kubeEndpointService: KubernetesEndpointService
          ) {
            this.podName = activatedRoute.snapshot.params.podName;

          File cf-org-space-service.service.ts has 332 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { Injectable, OnDestroy } from '@angular/core';
          import { Store } from '@ngrx/store';
          import { BehaviorSubject, combineLatest, Observable, of, Subscription } from 'rxjs';
          import {
            distinctUntilChanged,

            Function setupForGit has 98 lines of code (exceeds 25 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 => {

              Function getFolderSource has a Cognitive Complexity of 30 (exceeds 8 allowed). Consider refactoring.
              Open

              func getFolderSource(clientWebSocket *websocket.Conn, tempDir string, msg SocketMessage) (StratosProject, string, error) {
                  // The msg data is JSON for the Folder info
                  info := FolderSourceInfo{
                      WaitAfterUpload: false,
                  }
              Severity: Minor
              Found in src/jetstream/plugins/cfapppush/deploy.go - About 3 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

              File autoscaler-transform-policy.spec.ts has 328 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { isEqual } from './autoscaler-util';
              import {
                autoscalerTransformArrayToMap,
                autoscalerTransformMapToArray,
              } from './autoscaler-transform-policy';

                File services-helper-e2e.ts has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { browser, promise, protractor } from 'protractor';
                
                import { IService, IServiceInstance, IServicePlan } from '../../frontend/packages/cloud-foundry/src/cf-api-svc.types';
                import { CFResponse, createEmptyCfResponse } from '../../frontend/packages/cloud-foundry/src/store/types/cf-api.types';
                import { APIResource } from '../../frontend/packages/store/src/types/api.types';
                Severity: Minor
                Found in src/test-e2e/marketplace/services-helper-e2e.ts - About 3 hrs to fix

                  File shared.module.ts has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { CdkTableModule } from '@angular/cdk/table';
                  import { CommonModule } from '@angular/common';
                  import { NgModule } from '@angular/core';
                  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
                  import { RouterModule } from '@angular/router';
                  Severity: Minor
                  Found in src/frontend/packages/core/src/shared/shared.module.ts - About 3 hrs to fix

                    Method CFAppPush.deploy has 121 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (cfAppPush *CFAppPush) deploy(echoContext echo.Context) error {
                    
                        cnsiGUID := echoContext.Param("cnsiGuid")
                        orgGUID := echoContext.Param("orgGuid")
                        spaceGUID := echoContext.Param("spaceGuid")
                    Severity: Major
                    Found in src/jetstream/plugins/cfapppush/deploy.go - About 3 hrs to fix

                      Function ngOnInit has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        public ngOnInit() {
                          const contentElement = this.content.nativeElement;
                          const containerElement = this.container.nativeElement;
                      
                          this.stopped$ = new BehaviorSubject<boolean>(false);

                        File cf-user-list-config.service.ts has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { Router } from '@angular/router';
                        import { Store } from '@ngrx/store';
                        import { BehaviorSubject, combineLatest, Observable, of as observableOf } from 'rxjs';
                        import { filter, first, map, switchMap, tap } from 'rxjs/operators';
                        
                        

                          Function endpointActions has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            endpointActions(includeSeparators = false): IListAction<EndpointModel>[] {
                              // Add any additional actions that are per endpoint type
                              const customActions = entityCatalog.getAllEndpointTypes()
                                .map(endpoint => endpoint.definition.endpointListActions)
                                .filter(endpointListActions => !!endpointListActions)

                            Method CFHosting.Init has a Cognitive Complexity of 29 (exceeds 8 allowed). Consider refactoring.
                            Open

                            func (ch *CFHosting) Init() error {
                            
                                // Determine if we are running CF by presence of env var "VCAP_APPLICATION" and configure appropriately
                                if ch.portalProxy.Env().IsSet(VCapApplication) {
                                    log.Info("Detected that Console is deployed as a Cloud Foundry Application")
                            Severity: Minor
                            Found in src/jetstream/plugins/cloudfoundryhosting/main.go - About 3 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

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

                            func (p *portalProxy) DoLoginToCNSI(c echo.Context, cnsiGUID string, systemSharedToken bool) (*interfaces.LoginRes, error) {
                            
                                cnsiRecord, err := p.GetCNSIRecord(cnsiGUID)
                                if err != nil {
                                    return nil, interfaces.NewHTTPShadowError(
                            Severity: Minor
                            Found in src/jetstream/authcnsi.go - About 3 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

                            File application-wall-e2e.spec.ts has 320 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import { browser, promise } from 'protractor';
                            
                            import { IOrganization, ISpace } from '../../frontend/packages/cloud-foundry/src/cf-api.types';
                            import { APIResource } from '../../frontend/packages/store/src/types/api.types';
                            import { ApplicationE2eHelper } from '../application/application-e2e-helpers';
                            Severity: Minor
                            Found in src/test-e2e/applications/application-wall-e2e.spec.ts - About 3 hrs to fix

                              File specify-user-provided-details.component.ts has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { COMMA, ENTER, SPACE } from '@angular/cdk/keycodes';
                              import { HttpHeaders, HttpParams, HttpRequest } from '@angular/common/http';
                              import { Component, Input, OnDestroy } from '@angular/core';
                              import { FormControl, FormGroup, Validators } from '@angular/forms';
                              import { MatChipInputEvent } from '@angular/material/chips';

                                Method Analyzer.doRun has a Cognitive Complexity of 28 (exceeds 8 allowed). Consider refactoring.
                                Open

                                func (a *Analyzer) doRun(ec echo.Context) error {
                                
                                    log.Debug("Run analyzer!")
                                
                                    engine := ec.Param("analyzer")
                                Severity: Minor
                                Found in src/jetstream/plugins/analysis/container/run.go - About 3 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 ngOnInit has a Cognitive Complexity of 28 (exceeds 8 allowed). Consider refactoring.
                                Open

                                  ngOnInit() {
                                    this.hasFavEntities = this.userFavoriteManager.endpointHasEntitiesThatCanFavorite(this.endpoint.cnsi_type);
                                    // Favorites for this endpoint
                                    this.favorites$ = this.userFavoriteManager.getFavoritesForEndpoint(this.endpoint.guid);
                                    this.entity = entityCatalog.getEndpoint(this.endpoint.cnsi_type, this.endpoint.sub_type);

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language