cloudfoundry-incubator/stratos

View on GitHub

Showing 650 of 1,370 total issues

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

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

        Method CFAppSSH.appSSH has 94 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (cfAppSsh *CFAppSSH) appSSH(c echo.Context) error {
            // Need to get info for the endpoint
            // Get the CNSI and app IDs from route parameters
            cnsiGUID := c.Param("cnsiGuid")
            userGUID := c.Get("user_id").(string)
        Severity: Major
        Found in src/jetstream/plugins/cfappssh/app_ssh.go - About 2 hrs to fix

          Method HelmReleaseGraph.ProcessPod has a Cognitive Complexity of 23 (exceeds 8 allowed). Consider refactoring.
          Open

          func (r *HelmReleaseGraph) ProcessPod(id string, res KubeResource, spec v1.PodSpec, status v1.PodStatus) {
              // Look through volumes
              // name and: PersistentVolumeClaim.ClaimName or Secret.SecretName
              for _, volume := range spec.Volumes {
                  if volume.VolumeSource.PersistentVolumeClaim != nil {
          Severity: Minor
          Found in src/jetstream/plugins/kubernetes/helm/graph.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 findDatabaseConfig has a Cognitive Complexity of 23 (exceeds 8 allowed). Consider refactoring.
          Open

          func findDatabaseConfig(vcapServices map[string][]VCAPService, db *DatabaseConfig, env *env.VarSet) bool {
              var service VCAPService
              configs := findDatabaseConfigurations(vcapServices)
              log.Infof("Found %d database service instances", len(configs))
              for _, s := range configs {
          Severity: Minor
          Found in src/jetstream/datastore/database_cf_config.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 processObject has a Cognitive Complexity of 23 (exceeds 8 allowed). Consider refactoring.
          Open

          function processObject(object: any, output?: any, nested?: boolean) {
            if (nested && output) {
              output = { properties: output };
            } else {
              output = output || {};

          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 manage-users-modify.component.ts has 279 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
            ChangeDetectorRef,
            Component,
            ComponentFactory,
            ComponentFactoryResolver,

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

            import { Injectable } from '@angular/core';
            
            import { StratosStatus, StratosStatusMetadata } from '../../../../store/src/types/shared.types';
            import { AppStat } from '../../store/types/app-metadata.types';
            
            

              Function exports has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function (project) {
                var path = require('path')
                var repoRoot = path.join(__dirname, '..')
                return function (config) {
              
              
              Severity: Major
              Found in build/karma.conf.creator.js - About 2 hrs to fix

                Function initialiseSpaceObservables has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  private initialiseSpaceObservables() {
                    this.space$ = this.cfUserService.isConnectedUserAdmin(this.cfGuid).pipe(
                      switchMap(isAdmin => {
                        const relations = [
                          createEntityRelationKey(spaceEntityType, spaceQuotaEntityType),

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

                    constructor(
                      private config: IListDataSourceConfig<A, T>,
                    ) {
                      super();
                      this.init(config);

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

                    export class E2EHelpers {
                    
                      static e2eItemPrefix = 'acceptance.e2e.';
                      static customOrgSpaceLabel = E2EHelpers.e2eItemPrefix + (process.env.CUSTOM_ORG_SPACE_LABEL || process.env.USER);
                    
                    
                    Severity: Minor
                    Found in src/test-e2e/helpers/e2e-helpers.ts - About 2 hrs to fix

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

                      @Component({
                        selector: 'app-chart-values-editor',
                        templateUrl: './chart-values-editor.component.html',
                        styleUrls: ['./chart-values-editor.component.scss']
                      })

                        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>) { }

                          File kube-config-import.component.ts has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { Component, ComponentFactoryResolver, Injector, OnDestroy } from '@angular/core';
                          import { FormBuilder } from '@angular/forms';
                          import { Store } from '@ngrx/store';
                          import { BehaviorSubject, Observable, of as observableOf, Subscription } from 'rxjs';
                          import { distinctUntilChanged, filter, first, map, pairwise, startWith, withLatestFrom } from 'rxjs/operators';

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

                              constructor(public helmReleaseHelper: HelmReleaseHelperService) {
                            
                                // Use the ame column layout as the Helm CLI
                                this.columns = [
                                  {

                              Function generateHelmEntities has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function generateHelmEntities(): StratosBaseCatalogEntity[] {
                                const helmRepoRenderPriority = 10;
                                const endpointDefinition: StratosEndpointExtensionDefinition = {
                                  type: HELM_ENDPOINT_TYPE,
                                  logoUrl: '/core/assets/custom/helm.svg',
                              Severity: Major
                              Found in src/frontend/packages/kubernetes/src/helm/helm-entity-generator.ts - About 2 hrs to fix

                                Method CFAppSSH.appSSH has a Cognitive Complexity of 22 (exceeds 8 allowed). Consider refactoring.
                                Open

                                func (cfAppSsh *CFAppSSH) appSSH(c echo.Context) error {
                                    // Need to get info for the endpoint
                                    // Get the CNSI and app IDs from route parameters
                                    cnsiGUID := c.Param("cnsiGuid")
                                    userGUID := c.Get("user_id").(string)
                                Severity: Minor
                                Found in src/jetstream/plugins/cfappssh/app_ssh.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

                                Method PgsqlTokenRepository.FindAllCNSITokenBackup has a Cognitive Complexity of 22 (exceeds 8 allowed). Consider refactoring.
                                Open

                                func (p *PgsqlTokenRepository) FindAllCNSITokenBackup(cnsiGUID string, encryptionKey []byte) ([]interfaces.BackupTokenRecord, error) {
                                    log.Debug("FindAllCNSITokenBackup")
                                    if cnsiGUID == "" {
                                        msg := "Unable to find CNSI Token without a valid CNSI GUID."
                                        log.Debug(msg)
                                Severity: Minor
                                Found in src/jetstream/repository/tokens/pgsql_tokens.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

                                Severity
                                Category
                                Status
                                Source
                                Language