opf/openproject

View on GitHub
frontend/src/app/features/bim/bcf/bcf-wp-attribute-group/bcf-wp-attribute-group.component.ts

Summary

Maintainability
C
1 day
Test Coverage

File bcf-wp-attribute-group.component.ts has 268 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// -- copyright
// OpenProject is an open source project management software.
// Copyright (C) 2012-2024 the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or

    BcfWpAttributeGroupComponent has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Component({
      templateUrl: './bcf-wp-attribute-group.component.html',
      styleUrls: ['./bcf-wp-attribute-group.component.sass'],
      changeDetection: ChangeDetectionStrategy.OnPush,
      providers: [ViewpointsService],

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

        text = {
          bcf: this.I18n.t('js.bcf.label_bcf'),
          viewpoint: this.I18n.t('js.bcf.viewpoint'),
          add_viewpoint: this.I18n.t('js.bcf.add_viewpoint'),
          show_viewpoint: this.I18n.t('js.bcf.show_viewpoint'),
      frontend/src/app/features/admin/types/type-form-configuration.component.ts on lines 44..53
      frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.ts on lines 67..76
      frontend/src/app/shared/components/modals/save-modal/save-query.modal.ts on lines 58..67
      frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.ts on lines 56..65

      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 142.

      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 9 locations. Consider refactoring.
      Open

          this
            .apiV3Service
            .work_packages
            .id(this.workPackage)
            .requireAndStream()
      frontend/src/app/features/work-packages/components/wp-relations-count/wp-watchers-count.component.ts on lines 26..40
      frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.component.ts on lines 86..95
      frontend/src/app/features/work-packages/components/wp-relations/wp-relations-hierarchy/wp-relations-hierarchy.directive.ts on lines 88..114
      frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts on lines 107..116
      frontend/src/app/features/work-packages/components/wp-single-view-tabs/overview-tab/overview-tab.component.ts on lines 57..65
      frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.component.ts on lines 101..112
      frontend/src/app/features/work-packages/components/wp-watcher-button/wp-watcher-button.component.ts on lines 68..80
      frontend/src/app/features/work-packages/routing/wp-view-base/work-package-single-view.base.ts on lines 128..145

      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 48.

      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

      There are no issues that match your filters.

      Category
      Status