SUSE/stratos

View on GitHub

Showing 885 of 1,395 total issues

File pagination-monitor.ts has 315 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Store } from '@ngrx/store';
import { denormalize, schema as normalizrSchema } from '../../../store/src/normalizr/normalizr';

import { asapScheduler, combineLatest, Observable, ReplaySubject } from 'rxjs';
import { tag } from 'rxjs-spy/operators';
Severity: Minor
Found in src/frontend/packages/store/src/monitors/pagination-monitor.ts - About 3 hrs to fix

    File deploy.go has 562 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    package cfapppush
    
    import (
        "encoding/base64"
        "encoding/json"
    Severity: Minor
    Found in src/jetstream/plugins/cfapppush/deploy.go - About 3 hrs to fix

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

        constructor(
          ext: ExtensionService,
          private store: Store<GeneralEntityAppState>,
          eventService: GlobalEventService,
          private userFavoriteManager: UserFavoriteManager,
      Severity: Major
      Found in src/frontend/packages/core/src/app.module.ts - About 3 hrs to fix

        File cf-entity-factory.ts has 310 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { EntitySchema } from '../../store/src/helpers/entity-schema';
        import { metricEntityType } from '../../store/src/helpers/stratos-entity-factory';
        import { APIResource } from '../../store/src/types/api.types';
        import {
          CFApplicationEntitySchema,
        Severity: Minor
        Found in src/frontend/packages/cloud-foundry/src/cf-entity-factory.ts - About 3 hrs to fix

          File deploy-application-step2.component.ts has 310 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { HttpClient } from '@angular/common/http';
          import { AfterContentInit, Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
          import { NgForm } from '@angular/forms';
          import { ActivatedRoute } from '@angular/router';
          import { Store } from '@ngrx/store';

            Function hash has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public static hash( string: any ) : string
              {
                  let temp: string;
            
                  if ( typeof string !== 'string' )
            Severity: Major
            Found in src/frontend/packages/core/src/shared/components/user-avatar/md5.ts - About 3 hrs to fix

              Function InstallDashboard has a Cognitive Complexity of 27 (exceeds 8 allowed). Consider refactoring.
              Open

              func InstallDashboard(p interfaces.PortalProxy, endpointGUID, userGUID string) error {
                  // Download the Yaml for the dashboard
                  kubeDashboardImage := p.Env().String("STRATOS_KUBERNETES_DASHBOARD_IMAGE", "")
                  if len(kubeDashboardImage) == 0 {
                      kubeDashboardImage = dashboardInstallYAMLDownloadURL
              Severity: Minor
              Found in src/jetstream/plugins/kubernetes/dashboard/configure.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 update has 85 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                update(): void {
                  let width;
                  if (this.series.length) {
                    width = this.xScale.bandwidth();
                    this.bandwidth.emit(width);

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

                import { browser, promise } from 'protractor';
                
                import { e2e } from '../e2e';
                import { CFHelpers } from '../helpers/cf-e2e-helpers';
                import { ConsoleUserType } from '../helpers/e2e-helpers';
                Severity: Minor
                Found in src/test-e2e/application/application-deploy-e2e.spec.ts - About 3 hrs to fix

                  CfUserPermissionsChecker has 28 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  export class CfUserPermissionsChecker extends BaseCurrentUserPermissionsChecker implements ICurrentUserPermissionsChecker {
                    static readonly ALL_SPACES = 'PERMISSIONS__ALL_SPACES_PLEASE';
                  
                    constructor(private store: Store<GeneralEntityAppState>) {
                      super();

                    ListDataSource has 28 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    export abstract class ListDataSource<T, A = T> extends DataSource<T> implements IListDataSource<T> {
                    
                      // -------------- Public
                      // Core observables
                      public pagination$: Observable<PaginationEntityState>;

                      Function getDefaultInitialTestStratosStoreState has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getDefaultInitialTestStratosStoreState() {
                        return {
                          recentlyVisited: {},
                          userFavoritesGroups: {
                            busy: false,
                      Severity: Major
                      Found in src/frontend/packages/store/testing/src/store-test-helper.ts - About 3 hrs to fix

                        Function start has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          public start() {
                            if (this.isStarted()) {
                              return;
                            }
                        
                        

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

                          import { HttpClient, HttpErrorResponse, HttpParams } from '@angular/common/http';
                          import { Injectable } from '@angular/core';
                          import { Actions, Effect, ofType } from '@ngrx/effects';
                          import { Store } from '@ngrx/store';
                          import { catchError, mergeMap } from 'rxjs/operators';
                          Severity: Minor
                          Found in src/frontend/packages/store/src/effects/endpoint.effects.ts - About 3 hrs to fix

                            Method MetricsSpecification.getMetricsEndpoints has a Cognitive Complexity of 26 (exceeds 8 allowed). Consider refactoring.
                            Open

                            func (m *MetricsSpecification) getMetricsEndpoints(userGUID string, cnsiList []string) (map[string]EndpointMetricsRelation, error) {
                            
                                metricsProviders := make([]MetricsMetadata, 0)
                                endpointsMap := make(map[string]*interfaces.ConnectedEndpoint)
                                results := make(map[string]EndpointMetricsRelation)
                            Severity: Minor
                            Found in src/jetstream/plugins/metrics/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

                            Function PolymorphicSchema has a Cognitive Complexity of 26 (exceeds 8 allowed). Consider refactoring.
                            Open

                            var PolymorphicSchema = /*#__PURE__*/function () {
                              function PolymorphicSchema(definition, schemaAttribute) {
                                if (schemaAttribute) {
                                  this._schemaAttribute = typeof schemaAttribute === 'string' ? function (input) {
                                    return input[schemaAttribute];
                            Severity: Minor
                            Found in src/frontend/packages/store/src/normalizr/normalizr.js - 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

                            ServicesHelperE2E has 27 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            export class ServicesHelperE2E {
                            
                              constructor(public e2eSetup: E2ESetup, createServiceInstance: CreateMarketplaceServiceInstance = null, seed?: ServicesHelperE2E) {
                                this.cfRequestHelper = seed ? seed.cfRequestHelper : new CFRequestHelpers(e2eSetup);
                                this.cfHelper = seed ? seed.cfHelper : new CFHelpers(e2eSetup);
                            Severity: Minor
                            Found in src/test-e2e/marketplace/services-helper-e2e.ts - About 3 hrs to fix

                              File entity-catalog-entity.ts has 298 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { ActionReducer } from '@ngrx/store';
                              
                              import { IRequestEntityTypeState } from '../../app-state';
                              import {
                                EntitiesFetchHandler,

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

                                  ngOnInit() {
                                
                                    this.canManageCredentials$ = fetchAutoscalerInfo(
                                      this.applicationService.cfGuid,
                                      this.entityServiceFactory

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

                                  func (c *CFPushApp) Init(appDir string, manifestPath string, overrides CFPushAppOverrides) error {
                                  
                                      // App name
                                      if len(overrides.Name) > 0 {
                                          c.pushCommand.OptionalArgs = flag.OptionalAppName{
                                  Severity: Minor
                                  Found in src/jetstream/plugins/cfapppush/pushapp.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language