SUSE/stratos

View on GitHub

Showing 1,395 of 1,395 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

endpoints: {
cf: {
'0e934dc8-7ad4-40ff-b85c-53c1b61d2abb': {
global: {
isAdmin: false,
src/frontend/packages/cloud-foundry/src/shared/services/current-user-permissions-and-cfchecker.service.spec.ts on lines 624..900

Similar blocks of code found in 2 locations. Consider refactoring.
Open

endpoints: {
cf: {
'0e934dc8-7ad4-40ff-b85c-53c1b61d2abb': {
global: {
isAdmin: false,
src/frontend/packages/core/src/core/permissions/current-user-permissions.service.spec.ts on lines 160..436

Function createStoreState has 848 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createStoreState(): Partial<AppState<BaseEntityValues>> {
// Data
const endpoints: EndpointModel[] = [
{
guid: '0e934dc8-7ad4-40ff-b85c-53c1b61d2abb',

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

    import { Compiler, Injector } from '@angular/core';
    import { Action, Store } from '@ngrx/store';
    import { entityFetchedWithoutError } from '@stratosui/store';
    import { combineLatest, Observable, of } from 'rxjs';
    import { first, map } from 'rxjs/operators';
    Severity: Major
    Found in src/frontend/packages/cloud-foundry/src/cf-entity-generator.ts - About 2 days to fix

      File current-user-permissions-and-cfchecker.service.spec.ts has 1016 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { TestBed } from '@angular/core/testing';
      import { createBasicStoreModule, createEntityStoreState, TestStoreEntity } from '@stratosui/store/testing';
      import { first, tap } from 'rxjs/operators';
       
      import { PermissionConfig } from '../../../../core/src/core/permissions/current-user-permissions.config';

        Function createStoreState has 417 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createStoreState(): Partial<AppState<BaseEntityValues>> {
        // Data
        const endpoints: EndpointModel[] = [
        {
        guid: '0e934dc8-7ad4-40ff-b85c-53c1b61d2abb',

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          it('Usernames Step', () => {
          stepper.waitForStep('Usernames');
           
          const usernamesStep = manageUsersStepper.setUsernames;
          const addRemove = usernamesStep.addRemoveRadio;
          src/test-e2e/cloud-foundry/manage-users-by-username-stepper-e2e.spec.ts on lines 376..402

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          it('Usernames Step', () => {
          stepper.waitForStep('Usernames');
           
          const usernamesStep = manageUsersStepper.setUsernames;
          const addRemove = usernamesStep.addRemoveRadio;
          src/test-e2e/cloud-foundry/manage-users-by-username-stepper-e2e.spec.ts on lines 155..181

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          return uaaHelpers.setup()
          .then(() => e2e.log(`Creating User: ${userName}`))
          .then(() => uaaHelpers.createUser(userName))
          .then(newUser => {
          uaaUserGuid = newUser.id;
          Severity: Major
          Found in src/test-e2e/cloud-foundry/users-removal-e2e.helper.ts and 1 other location - About 1 day to fix
          src/test-e2e/cloud-foundry/manage-users-by-username-stepper-e2e.spec.ts on lines 50..86

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          return uaaHelpers.setup()
          .then(() => e2e.log(`Creating User: ${userName}`))
          .then(() => uaaHelpers.createUser(userName))
          .then(newUser => {
          uaaUserGuid = newUser.id;
          src/test-e2e/cloud-foundry/users-removal-e2e.helper.ts on lines 59..95

          File list.component.ts has 655 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { animate, style, transition, trigger } from '@angular/animations';
          import {
          AfterViewInit,
          ChangeDetectorRef,
          Component,

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

            constructor() {
            const endpointDef: StratosEndpointExtensionDefinition = {
            type: KUBERNETES_ENDPOINT_TYPE,
            label: 'Kubernetes',
            labelPlural: 'Kubernetes',

              File main.go has 879 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              package main
               
              import (
              "crypto/sha1"
              "crypto/tls"
              Severity: Major
              Found in src/jetstream/main.go - About 1 day to fix

                File kubernetes-entity-generator.ts has 599 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { Compiler, Injector } from '@angular/core';
                import { Validators } from '@angular/forms';
                import moment from 'moment';
                 
                import { BaseEndpointAuth } from '../../../core/src/core/endpoint-auth';

                  Function initialise has 259 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  private initialise() {
                  this.globalActions = this.setupActionsDefaultObservables(
                  this.config.getGlobalActions()
                  );
                  this.multiActions = this.setupActionsDefaultObservables(

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    this.cardMenu = [
                    {
                    label: 'Edit',
                    action: this.edit,
                    can: this.currentUserPermissionsService.can(
                    src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/services-wall/service-instance-card/service-instance-card.component.ts on lines 52..81

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    this.cardMenu = [
                    {
                    label: 'Edit',
                    action: this.edit,
                    can: this.currentUserPermissionsService.can(
                    src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/services-wall/user-provided-service-instance-card/user-provided-service-instance-card.component.ts on lines 56..85

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

                    import { HttpClient, HttpErrorResponse } from '@angular/common/http';
                    import { Injectable } from '@angular/core';
                    import { Actions, Effect, ofType } from '@ngrx/effects';
                    import { Action, Store } from '@ngrx/store';
                    import { Observable } from 'rxjs';
                    Severity: Major
                    Found in src/frontend/packages/cf-autoscaler/src/store/autoscaler.effects.ts - About 1 day to fix

                      Method KubeTerminal.cleanup has a Cognitive Complexity of 58 (exceeds 8 allowed). Consider refactoring.
                      Open

                      func (k *KubeTerminal) cleanup() {
                      // Use a random initial wait before cleaning up
                      // If we had more than one backend, this helps to ensure they are not all trying to cleanup at the same time
                      wait := rand.Intn(30)
                      log.Debug("Kubernetes Terminal cleanup will start in %d minutes", wait)
                      Severity: Minor
                      Found in src/jetstream/plugins/kubernetes/terminal/cleanup.go - About 1 day to fix

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

                      import moment from 'moment-timezone';
                      import { browser, promise } from 'protractor';
                      import { timer } from 'rxjs';
                      import { switchMap } from 'rxjs/operators';
                       
                       
                      Severity: Major
                      Found in src/test-e2e/application/application-autoscaler-e2e.spec.ts - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language