cloudfoundry/stratos

View on GitHub

Showing 718 of 1,370 total issues

Function constructStatusObservables has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private constructStatusObservables() {
    this.isFetchingApp$ = this.entityService.isFetchingEntity$;

    this.isUpdatingApp$ = this.entityService.entityObs$.pipe(map(a => {
      const updatingRoot = a.entityRequestInfo.updating[rootUpdatingKey] || { busy: false };

    Function jsonFilter has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public jsonFilter(jsonString: string): string {
        let filtered = jsonString;
        try {
          const cfEvent: FireHoseItem = JSON.parse(jsonString);
          switch (cfEvent.eventType) {

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

        constructor(public applicationService: ApplicationService) {
          const chartConfigBuilder = getMetricsChartConfigBuilder<IMetricApplication>(result => `Instance ${result.metric.instance_index}`);
          this.instanceMetricConfigs = [
            chartConfigBuilder(
              new FetchApplicationChartMetricsAction(

        Function doRegister has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private doRegister(reg: KubeConfigImportAction, next: KubeConfigImportAction[]) {
            const obs$ = this.registerEndpoint(
              reg.cluster.name,
              reg.cluster.cluster.server,
              reg.cluster.cluster['insecure-skip-tls-verify'],

          Function getAuthDataForConnect has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public getAuthDataForConnect(resolver: ComponentFactoryResolver, injector: Injector, fb: FormBuilder, user: KubeConfigFileUser)
              : ConnectEndpointData | null {
          
              let data = null;
          
          

            Function uaaSetupReducer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function uaaSetupReducer(state: UAASetupState = defaultState, action) {
              switch (action.type) {
                case SETUP_GET_SCOPES:
                case SETUP_SAVE_CONFIG:
                  return {
            Severity: Minor
            Found in src/frontend/packages/store/src/reducers/uaa-setup.reducers.ts - About 1 hr to fix

              Function setupInputSub has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                private setupInputSub() {
                  this.stopInputSub();
                  this.sub = combineLatest(
                    this.timeObservable,
                    this.dateObservable

                Function setupObservables has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  private setupObservables() {
                    this.update$ = stratosEntityCatalog.endpoint.store.getEntityMonitor(this.config.guid).getUpdatingSection(ConnectEndpoint.UpdatingKey)
                      .pipe(filter(update => !!update));
                
                    this.fetchingInfo$ = stratosEntityCatalog.endpoint.store.getEntityMonitor(this.config.guid).entityRequest$.pipe(

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

                    constructor(
                      public pageHeaderService: PageHeaderService,
                      private store: Store<DashboardOnlyAppState>,
                      private breakpointObserver: BreakpointObserver,
                      private router: Router,

                    Function init has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      private init(config: ConnectEndpointConfig) {
                        const endpoint = entityCatalog.getEndpoint(config.type, config.subType);
                        // Populate the valid auth types for the endpoint that we want to connect to
                    
                        // Remove SSO if not allowed on this endpoint

                      Function deleteWarn has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        public deleteWarn() {
                          // Namespace vs Pod definition in different places
                          const defn = (this.data.definition?.definition || this.data.definition) as KubeResourceEntityDefinition;
                          this.sidePanelService.hide();
                          const confirmation = new ConfirmationDialogConfig(

                        Method Analyzer.doRun has 12 return statements (exceeds 4 allowed).
                        Open

                        func (a *Analyzer) doRun(ec echo.Context) error {
                        
                            log.Debug("Run analyzer!")
                        
                            engine := ec.Param("analyzer")
                        Severity: Major
                        Found in src/jetstream/plugins/analysis/container/run.go - About 1 hr to fix

                          Function getFolderSource has 12 return statements (exceeds 4 allowed).
                          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: Major
                          Found in src/jetstream/plugins/cfapppush/deploy.go - About 1 hr to fix

                            Method portalProxy.DoLoginToCNSI has 12 return statements (exceeds 4 allowed).
                            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: Major
                            Found in src/jetstream/authcnsi.go - About 1 hr to fix

                              Function validateEntityRelations has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function validateEntityRelations(config: ValidateEntityRelationsConfig): ValidationResult {
                                const pAction = isPaginatedAction(config.action);
                              
                                if (!!pAction && pAction.__forcedPageEntityConfig__) {
                                  const entityConfig = pAction.__forcedPageEntityConfig__;

                                Function setupList has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  private setupList(appService: ApplicationService) {
                                    this.text = {
                                      title: 'Available Routes',
                                      noEntries: 'There are no routes'
                                    };

                                  Function setUpTestOrgSpaceUserRoles has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function setUpTestOrgSpaceUserRoles(
                                    cfGuid: string,
                                    defaultCf: E2EConfigCloudFoundry,
                                    orgName: string,
                                    spaceName: string,
                                  Severity: Minor
                                  Found in src/test-e2e/cloud-foundry/users-list-e2e.helper.ts - About 1 hr to fix

                                    Function customSassImport has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      private customSassImport(config: StratosConfig) {
                                        const that = this;
                                        return (url, resourcePath) => {
                                          if (url === '~@stratosui/theme/extensions') {
                                            // Generate SCSS to appy theming to the packages that need to be themed
                                    Severity: Minor
                                    Found in src/frontend/packages/devkit/src/build/sass.ts - About 1 hr to fix

                                      Function getCheckedState has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        private static getCheckedState(
                                          role: string,
                                          users: CfUser[],
                                          existingRoles: CfUserRolesSelected,
                                          newRoles: IUserPermissionInOrg,

                                        Function validate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          validate(c: AbstractControl): Observable<GithubProjectExistsResponse> {
                                            if (c.value) {
                                              if (!this.isValidProjectName(c.value) || this.haveAlreadyChecked(c.value)) {
                                                return observableOf({
                                                  githubProjectDoesNotExist: true,
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language