opf/openproject

View on GitHub
frontend/src/app/features/enterprise/enterprise-trial.service.ts

Summary

Maintainability
A
3 hrs
Test Coverage

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

  public getToken():void {
    // 2) GET /public/v1/trials/:id
    this.http.get(
      this.store.getValue().trialLink as string,
      {
Severity: Minor
Found in frontend/src/app/features/enterprise/enterprise-trial.service.ts - About 1 hr to fix

    Function sendForm has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public sendForm(form:UntypedFormGroup):Promise<unknown> {
        const request:unknown = { ...form.value, token_version: this.tokenVersion };
        return this.http
          .post(
            `${this.baseUrlAugur}/public/v1/trials`,
    Severity: Minor
    Found in frontend/src/app/features/enterprise/enterprise-trial.service.ts - About 1 hr to fix

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

        public text = {
          invalid_email: this.I18n.t('js.admin.enterprise.trial.form.invalid_email'),
          taken_email: this.I18n.t('js.admin.enterprise.trial.form.taken_email'),
          taken_domain: this.I18n.t('js.admin.enterprise.trial.form.taken_domain'),
        };
      frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.ts on lines 64..68
      frontend/src/app/features/boards/board/board-actions/version/version-board-header.component.ts on lines 45..49
      frontend/src/app/features/homescreen/blocks/new-features.component.ts on lines 81..85
      frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.ts on lines 65..69
      frontend/src/app/features/team-planner/team-planner/add-work-packages/add-existing-pane.component.ts on lines 104..108
      frontend/src/app/features/user-preferences/notifications-settings/inline-create/notification-setting-inline-create.component.ts on lines 35..39
      frontend/src/app/features/user-preferences/reminder-settings/immediate-reminders/immediate-reminder-settings.component.ts on lines 21..25
      frontend/src/app/features/work-packages/components/wp-buttons/wp-status-button/wp-status-button.component.ts on lines 50..54
      frontend/src/app/features/work-packages/components/wp-relations/wp-relations-create/wp-relations-create.component.ts on lines 26..30
      frontend/src/app/features/work-packages/components/wp-table/sort-header/sort-header.directive.ts on lines 70..74
      frontend/src/app/shared/components/attribute-help-texts/attribute-help-text.component.ts on lines 65..69
      frontend/src/app/shared/components/attribute-help-texts/attribute-help-text.modal.ts on lines 43..47
      frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.ts on lines 124..128
      frontend/src/app/shared/components/grids/widgets/members/members.component.ts on lines 28..32
      frontend/src/app/shared/components/project-include/list/project-include-list.component.ts on lines 77..81
      frontend/src/app/shared/components/time_entries/timer/timer-account-menu.component.ts on lines 54..58
      modules/gitlab_integration/frontend/module/issue/issue.component.ts on lines 47..51

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

      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