cloudfoundry-incubator/stratos

View on GitHub

Showing 1,111 of 1,370 total issues

Function createEndpointTypeFilter has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private createEndpointTypeFilter(): IListMultiFilterConfig {
    return {
      key: BaseEndpointsDataSource.typeFilterKey,
      label: 'Endpoint Type',
      list$: combineLatest([

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

    describe('EditQuotaStepComponent', () => {
      let component: EditQuotaStepComponent;
      let fixture: ComponentFixture<EditQuotaStepComponent>;
    
      beforeEach(async(() => {
    src/frontend/packages/cloud-foundry/src/features/cf/edit-quota/edit-quota.component.spec.ts on lines 10..45
    src/frontend/packages/cloud-foundry/src/features/cf/edit-space-quota/edit-space-quota.component.spec.ts on lines 10..45

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 217.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    describe('TableCellAppStatusComponent', () => {
      let component: TableCellAppStatusComponent;
      let fixture: ComponentFixture<TableCellAppStatusComponent>;
    
      beforeEach(async(() => {
    src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/app/table-cell-app-cforgspace-header/table-cell-app-cforgspace-header.component.spec.ts on lines 22..57

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 217.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    describe('TableCellAppCfOrgSpaceHeaderComponent', () => {
      let component: TableCellAppCfOrgSpaceHeaderComponent;
      let fixture: ComponentFixture<TableCellAppCfOrgSpaceHeaderComponent>;
    
      beforeEach(async(() => {
    src/frontend/packages/cloud-foundry/src/shared/components/list/list-types/app/table-cell-app-status/table-cell-app-status.component.spec.ts on lines 21..56

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 217.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    describe('EditQuotaComponent', () => {
      let component: EditQuotaComponent;
      let fixture: ComponentFixture<EditQuotaComponent>;
    
      beforeEach(async(() => {
    src/frontend/packages/cloud-foundry/src/features/cf/edit-quota/edit-quota-step/edit-quota-step.component.spec.ts on lines 9..44
    src/frontend/packages/cloud-foundry/src/features/cf/edit-space-quota/edit-space-quota.component.spec.ts on lines 10..45

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 217.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    describe('EditSpaceQuotaComponent', () => {
      let component: EditSpaceQuotaComponent;
      let fixture: ComponentFixture<EditSpaceQuotaComponent>;
    
      beforeEach(async(() => {
    src/frontend/packages/cloud-foundry/src/features/cf/edit-quota/edit-quota-step/edit-quota-step.component.spec.ts on lines 9..44
    src/frontend/packages/cloud-foundry/src/features/cf/edit-quota/edit-quota.component.spec.ts on lines 10..45

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 217.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function findFreePort has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function findFreePort(beg, ...rest){
      const p = rest.slice(0, rest.length - 1), cb = rest[rest.length - 1];
      let [end, ip, cnt] = Array.from(p);
      if (!ip && end && !/^\d+$/.test(end)) { // deal with method 3
        ip = end;
    Severity: Minor
    Found in electron/freeport.js - About 1 hr to fix

      Function createProvider has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private createProvider(cfGuid: string): ActionListConfigProvider<APIResource<IOrganization>> {
          const action = CloudFoundryEndpointService.createGetAllOrganizations(cfGuid);
          const provider = new ActionListConfigProvider<APIResource<IOrganization>>(this.store, action);
      
          provider.updateListConfig({

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

          ngOnInit() {
            this.connectionStatus.next(0);
            const guid = this.kubeEndpointService.baseKube.guid;
            this.kubeSummaryLink = `/kubernetes/${guid}/summary`;
        
        

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

            constructor(
              store: Store<AppState>,
              kubeId: BaseKubeGuid,
            ) {
              const transformEntities: DataFunction<KubernetesNode>[] = [

            Function getCaaspNodesData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              getCaaspNodesData(nodes$: Observable<KubernetesNode[]> = this.nodes$): Observable<CaaspNodesData> {
                return nodes$.pipe(
                  map(nodes => {
                    const info: CaaspNodesData = {
                      version: 'Unknown',

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

                constructor(
                  private store: Store<AppState>,
                  private route: ActivatedRoute,
                  private tabNavService: TabNavService,
                  private router: Router,

                Function handleOther has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  private handleOther(auth: AuthState) {
                    this.loggedIn = auth.loggedIn;
                    this.loggingIn = auth.loggingIn;
                    this.isLoginFlow = this.isLoginFlow || auth.loggingIn;
                    this.verifying = auth.verifying;

                  Function links$ has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        map(([favs, layout]) => {
                          // Get the list of shortcuts for the endpoint for the given endpoint ID
                          const shortcutsFn = this.definition?.homeCard?.shortcuts;
                          const allShortcuts = shortcutsFn ? shortcutsFn(this.endpoint.guid) || [] : [];
                          let shortcuts = allShortcuts;

                    Function SetStructFieldValue has 57 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func SetStructFieldValue(value reflect.Value, field reflect.Value, val string) error {
                    
                        var newVal interface{}
                        var err error
                        typ := field.Type()
                    Severity: Minor
                    Found in src/jetstream/repository/interfaces/config/config.go - About 1 hr to fix

                      Method CustomBinder.bindData has 57 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func (b *CustomBinder) bindData(ptr interface{}, data map[string][]string, tag string) error {
                          typ := reflect.TypeOf(ptr).Elem()
                          val := reflect.ValueOf(ptr).Elem()
                      
                          if typ.Kind() != reflect.Struct {
                      Severity: Minor
                      Found in src/jetstream/custombinder/custombinder.go - About 1 hr to fix

                        Function configure has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          module.exports.configure = function (config) {
                            config.seleniumAddress = 'http://hub-cloud.browserstack.com/wd/hub';
                            config.capabilities = defaultCapabilities
                            config.directConnect = false;
                            setCapabilties(config.capabilities);
                        Severity: Minor
                        Found in src/test-e2e/browserstack-helper.js - About 1 hr to fix

                          Function navToPage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function navToPage() {
                              describe('', () => {
                          
                                // Allow additional time for navigation
                                extendE2ETestTime(70000);
                          Severity: Minor
                          Found in src/test-e2e/cloud-foundry/space-level/cf-space-level-e2e.spec.ts - About 1 hr to fix

                            Function getAllTheThings has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function getAllTheThings(store: Store<GeneralAppState>, guid: string, schemaKey: string) {
                              const entities = {
                                [entitySchema.key]: {
                                  [guid]: {
                                    guid,
                            Severity: Minor
                            Found in src/frontend/packages/store/src/entity-service.spec.ts - About 1 hr to fix

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

                                constructor(
                                  definition: IStratosEntityDefinition | IStratosEndpointDefinition | IStratosBaseEntityDefinition,
                                  public readonly builders: EntityCatalogBuilders<T, Y, AB> = {}
                                ) {
                                  this.definition = this.populateEntity(definition);
                                Severity
                                Category
                                Status
                                Source
                                Language