opf/openproject

View on GitHub

Showing 1,045 of 1,693 total issues

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

  openStateLink(event:{ workPackageId:string; requestedState:'show'|'split' }) {
    const params = {
      workPackageId: event.workPackageId,
      focus: true,
    };
frontend/src/app/features/work-packages/routing/wp-list-view/wp-list-view.component.ts on lines 185..196

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

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

@Component({
  selector: opModalSingleDatePickerSelector,
  templateUrl: './modal-single-date-picker.component.html',
  styleUrls: ['../styles/datepicker.modal.sass', './modal-single-date-picker.component.sass'],
  changeDetection: ChangeDetectionStrategy.OnPush,
frontend/src/app/shared/components/datepicker/basic-range-date-picker/basic-range-date-picker.component.ts on lines 66..232

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

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

@Component({
  selector: opBasicRangeDatePickerSelector,
  templateUrl: './basic-range-date-picker.component.html',
  styleUrls: [
    '../styles/datepicker.modal.sass',
frontend/src/app/shared/components/datepicker/modal-single-date-picker/modal-single-date-picker.component.ts on lines 64..296

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

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

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

    } else if (selectedDate > parsedEndDate) {
      if (activeField === 'end') {
        this.applyNewDates([parsedStartDate, selectedDate]);
      } else {
        // Reset and end date
frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.ts on lines 699..712

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

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

  public text = {
    edit: this.i18n.t('js.button_edit'),
    delete: this.i18n.t('js.button_delete'),
    error: this.i18n.t('js.error.internal'),
    areYouSure: this.i18n.t('js.text_are_you_sure'),
frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts on lines 96..101
frontend/src/app/features/projects/components/new-project/new-project.component.ts on lines 38..43
frontend/src/app/features/user-preferences/reminder-settings/pause-reminders/pause-reminders.component.ts on lines 30..35
frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts on lines 71..76
frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts on lines 94..99
frontend/src/app/features/work-packages/components/wp-baseline/baseline-legends/baseline-legends.component.ts on lines 81..86
frontend/src/app/features/work-packages/components/wp-baseline/baseline-modal/baseline-modal.component.ts on lines 46..52
frontend/src/app/features/work-packages/components/wp-breadcrumb/wp-breadcrumb-parent.component.ts on lines 48..53
frontend/src/app/features/work-packages/components/wp-buttons/wp-create-button/wp-create-button.component.ts on lines 59..64
frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts on lines 81..86
frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts on lines 18..23
frontend/src/app/shared/components/modals/share-modal/query-sharing-form.component.ts on lines 27..33
frontend/src/app/shared/components/table-pagination/table-pagination.component.ts on lines 63..68
frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts on lines 42..48
modules/github_integration/frontend/module/pull-request/pull-request.component.ts on lines 57..62
modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts on lines 48..53

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

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

  text = {
    workPackage: this.I18n.t('js.label_work_package'),
    start_timer: this.I18n.t('js.timer.start_new_timer'),
    stop_timer: this.I18n.t('js.timer.button_stop'),
    timer_already_stopped: this.I18n.t('js.timer.timer_already_stopped'),
frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts on lines 96..101
frontend/src/app/features/projects/components/new-project/new-project.component.ts on lines 38..43
frontend/src/app/features/user-preferences/reminder-settings/pause-reminders/pause-reminders.component.ts on lines 30..35
frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts on lines 71..76
frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts on lines 94..99
frontend/src/app/features/work-packages/components/wp-baseline/baseline-legends/baseline-legends.component.ts on lines 81..86
frontend/src/app/features/work-packages/components/wp-baseline/baseline-modal/baseline-modal.component.ts on lines 46..52
frontend/src/app/features/work-packages/components/wp-breadcrumb/wp-breadcrumb-parent.component.ts on lines 48..53
frontend/src/app/features/work-packages/components/wp-buttons/wp-create-button/wp-create-button.component.ts on lines 59..64
frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts on lines 18..23
frontend/src/app/shared/components/modals/share-modal/query-sharing-form.component.ts on lines 27..33
frontend/src/app/shared/components/table-pagination/table-pagination.component.ts on lines 63..68
frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts on lines 55..60
frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts on lines 42..48
modules/github_integration/frontend/module/pull-request/pull-request.component.ts on lines 57..62
modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts on lines 48..53

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

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

    buttons: {
      submit: this.i18n.t('js.storages.choose_location'),
      submitEmptySelection: this.i18n.t('js.storages.file_links.selection_none'),
      cancel: this.i18n.t('js.button_cancel'),
      selectAll: this.i18n.t('js.storages.file_links.select_all'),
frontend/src/app/features/admin/types/type-banner.service.ts on lines 17..22
frontend/src/app/features/invite-user-modal/principal/principal.component.ts on lines 81..86
frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/sort-by-tab.component.ts on lines 34..39
frontend/src/app/shared/components/header-project-select/header-project-select.component.ts on lines 130..135

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

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

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

    if (eeTrialKey && !data) {
      // after reload: get data from Augur using the trial key saved in gon
      const trialLink = `${this.eeTrialService.baseUrlAugur}/public/v1/trials/${eeTrialKey.value}`;
      this.eeTrialService.store.update({ trialLink });
      this.getUserDataFromAugur(trialLink);
frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.ts on lines 101..106

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

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

  public text = {
    title: this.I18n.t('js.chart.modal_title'),
    closePopup: this.I18n.t('js.close_popup_title'),

    applyButton: this.I18n.t('js.modals.button_apply'),
frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts on lines 96..101
frontend/src/app/features/projects/components/new-project/new-project.component.ts on lines 38..43
frontend/src/app/features/user-preferences/reminder-settings/pause-reminders/pause-reminders.component.ts on lines 30..35
frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts on lines 71..76
frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts on lines 94..99
frontend/src/app/features/work-packages/components/wp-baseline/baseline-legends/baseline-legends.component.ts on lines 81..86
frontend/src/app/features/work-packages/components/wp-baseline/baseline-modal/baseline-modal.component.ts on lines 46..52
frontend/src/app/features/work-packages/components/wp-breadcrumb/wp-breadcrumb-parent.component.ts on lines 48..53
frontend/src/app/features/work-packages/components/wp-buttons/wp-create-button/wp-create-button.component.ts on lines 59..64
frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts on lines 81..86
frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts on lines 18..23
frontend/src/app/shared/components/modals/share-modal/query-sharing-form.component.ts on lines 27..33
frontend/src/app/shared/components/table-pagination/table-pagination.component.ts on lines 63..68
frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts on lines 55..60
modules/github_integration/frontend/module/pull-request/pull-request.component.ts on lines 57..62
modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts on lines 48..53

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

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

  public text = {
    editTitle: this.I18n.t('js.label_add_comment_title'),
    addComment: this.I18n.t('js.label_add_comment'),
    cancelTitle: this.I18n.t('js.label_cancel_comment'),
    placeholder: this.I18n.t('js.label_add_comment_title'),
frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts on lines 96..101
frontend/src/app/features/projects/components/new-project/new-project.component.ts on lines 38..43
frontend/src/app/features/user-preferences/reminder-settings/pause-reminders/pause-reminders.component.ts on lines 30..35
frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts on lines 94..99
frontend/src/app/features/work-packages/components/wp-baseline/baseline-legends/baseline-legends.component.ts on lines 81..86
frontend/src/app/features/work-packages/components/wp-baseline/baseline-modal/baseline-modal.component.ts on lines 46..52
frontend/src/app/features/work-packages/components/wp-breadcrumb/wp-breadcrumb-parent.component.ts on lines 48..53
frontend/src/app/features/work-packages/components/wp-buttons/wp-create-button/wp-create-button.component.ts on lines 59..64
frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts on lines 81..86
frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts on lines 18..23
frontend/src/app/shared/components/modals/share-modal/query-sharing-form.component.ts on lines 27..33
frontend/src/app/shared/components/table-pagination/table-pagination.component.ts on lines 63..68
frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts on lines 55..60
frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts on lines 42..48
modules/github_integration/frontend/module/pull-request/pull-request.component.ts on lines 57..62
modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts on lines 48..53

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

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

      label: {
        User: this.I18n.t('js.invite_user_modal.principal.label.name_or_email'),
        PlaceholderUser: this.I18n.t('js.invite_user_modal.principal.label.name'),
        Group: this.I18n.t('js.invite_user_modal.principal.label.name'),
        Email: this.I18n.t('js.label_email'),
frontend/src/app/features/admin/types/type-banner.service.ts on lines 17..22
frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/sort-by-tab.component.ts on lines 34..39
frontend/src/app/shared/components/header-project-select/header-project-select.component.ts on lines 130..135
frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.ts on lines 72..77

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

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

  public text = {
    toggle_title: this.I18n.t('js.baseline.toggle_title'),
    header_description: this.I18n.t('js.baseline.header_description'),
    clear: this.I18n.t('js.baseline.clear'),
    apply: this.I18n.t('js.baseline.apply'),
frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts on lines 96..101
frontend/src/app/features/projects/components/new-project/new-project.component.ts on lines 38..43
frontend/src/app/features/user-preferences/reminder-settings/pause-reminders/pause-reminders.component.ts on lines 30..35
frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts on lines 71..76
frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts on lines 94..99
frontend/src/app/features/work-packages/components/wp-baseline/baseline-legends/baseline-legends.component.ts on lines 81..86
frontend/src/app/features/work-packages/components/wp-breadcrumb/wp-breadcrumb-parent.component.ts on lines 48..53
frontend/src/app/features/work-packages/components/wp-buttons/wp-create-button/wp-create-button.component.ts on lines 59..64
frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts on lines 81..86
frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts on lines 18..23
frontend/src/app/shared/components/modals/share-modal/query-sharing-form.component.ts on lines 27..33
frontend/src/app/shared/components/table-pagination/table-pagination.component.ts on lines 63..68
frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts on lines 55..60
frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts on lines 42..48
modules/github_integration/frontend/module/pull-request/pull-request.component.ts on lines 57..62
modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts on lines 48..53

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

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

  isNonWorkingDay(date:Date|string):boolean {
    const formatted = moment(date).format('YYYY-MM-DD');
    return (this.nonWorkingDays.findIndex((el) => el.date === formatted) !== -1);
  }
frontend/src/app/features/calendar/op-work-packages-calendar.service.ts on lines 154..157
frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-baseline.service.ts on lines 126..129

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

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

  public text = {
    displayedDays: this.I18n.t('js.grid.widgets.time_entries_current_user.displayed_days'),
    closePopup: this.I18n.t('js.close_popup_title'),
    applyButton: this.I18n.t('js.modals.button_apply'),
    cancelButton: this.I18n.t('js.modals.button_cancel'),
frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts on lines 96..101
frontend/src/app/features/projects/components/new-project/new-project.component.ts on lines 38..43
frontend/src/app/features/user-preferences/reminder-settings/pause-reminders/pause-reminders.component.ts on lines 30..35
frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts on lines 71..76
frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts on lines 94..99
frontend/src/app/features/work-packages/components/wp-baseline/baseline-legends/baseline-legends.component.ts on lines 81..86
frontend/src/app/features/work-packages/components/wp-baseline/baseline-modal/baseline-modal.component.ts on lines 46..52
frontend/src/app/features/work-packages/components/wp-breadcrumb/wp-breadcrumb-parent.component.ts on lines 48..53
frontend/src/app/features/work-packages/components/wp-buttons/wp-create-button/wp-create-button.component.ts on lines 59..64
frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts on lines 81..86
frontend/src/app/shared/components/modals/share-modal/query-sharing-form.component.ts on lines 27..33
frontend/src/app/shared/components/table-pagination/table-pagination.component.ts on lines 63..68
frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts on lines 55..60
frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts on lines 42..48
modules/github_integration/frontend/module/pull-request/pull-request.component.ts on lines 57..62
modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts on lines 48..53

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

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

  text = {
    label: this.I18n.t('js.reminders.settings.pause.label'),
    date_placeholder: this.I18n.t('js.placeholders.date'),
    first_day: this.I18n.t('js.reminders.settings.pause.first_day'),
    last_day: this.I18n.t('js.reminders.settings.pause.first_day'),
frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts on lines 96..101
frontend/src/app/features/projects/components/new-project/new-project.component.ts on lines 38..43
frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts on lines 71..76
frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts on lines 94..99
frontend/src/app/features/work-packages/components/wp-baseline/baseline-legends/baseline-legends.component.ts on lines 81..86
frontend/src/app/features/work-packages/components/wp-baseline/baseline-modal/baseline-modal.component.ts on lines 46..52
frontend/src/app/features/work-packages/components/wp-breadcrumb/wp-breadcrumb-parent.component.ts on lines 48..53
frontend/src/app/features/work-packages/components/wp-buttons/wp-create-button/wp-create-button.component.ts on lines 59..64
frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts on lines 81..86
frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts on lines 18..23
frontend/src/app/shared/components/modals/share-modal/query-sharing-form.component.ts on lines 27..33
frontend/src/app/shared/components/table-pagination/table-pagination.component.ts on lines 63..68
frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts on lines 55..60
frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts on lines 42..48
modules/github_integration/frontend/module/pull-request/pull-request.component.ts on lines 57..62
modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts on lines 48..53

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

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

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

      if (data) {
        // after reload: get data from Augur using the trial key saved in gon
        const trialLink = `${this.eeTrialService.baseUrlAugur}/public/v1/trials/${eeTrialKey.value}`;
        this.eeTrialService.store.update({ trialLink });
        this.getUserDataFromAugur(trialLink);
frontend/src/app/features/enterprise/enterprise-active-trial/ee-active-trial.component.ts on lines 96..101

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

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

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

    } else if (selectedDate > parsedEndDate) {
      if (activeField === 'end') {
        this.applyNewDates([parsedStartDate, selectedDate]);
      } else {
        // Reset duration and end date
frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.ts on lines 392..404

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

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

  isNonWorkingDay(date:Date|string):boolean {
    const formatted = moment(date).format('YYYY-MM-DD');
    return (this.nonWorkingDays.findIndex((el) => el.date === formatted) !== -1);
  }
frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts on lines 394..397
frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-baseline.service.ts on lines 126..129

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

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

  public text = {
    showInMenu: this.I18n.t('js.label_star_query'),
    visibleForOthers: this.I18n.t('js.label_public_query'),

    showInMenuText: this.I18n.t('js.work_packages.query.star_text'),
frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts on lines 96..101
frontend/src/app/features/projects/components/new-project/new-project.component.ts on lines 38..43
frontend/src/app/features/user-preferences/reminder-settings/pause-reminders/pause-reminders.component.ts on lines 30..35
frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts on lines 71..76
frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts on lines 94..99
frontend/src/app/features/work-packages/components/wp-baseline/baseline-legends/baseline-legends.component.ts on lines 81..86
frontend/src/app/features/work-packages/components/wp-baseline/baseline-modal/baseline-modal.component.ts on lines 46..52
frontend/src/app/features/work-packages/components/wp-breadcrumb/wp-breadcrumb-parent.component.ts on lines 48..53
frontend/src/app/features/work-packages/components/wp-buttons/wp-create-button/wp-create-button.component.ts on lines 59..64
frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts on lines 81..86
frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts on lines 18..23
frontend/src/app/shared/components/table-pagination/table-pagination.component.ts on lines 63..68
frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts on lines 55..60
frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts on lines 42..48
modules/github_integration/frontend/module/pull-request/pull-request.component.ts on lines 57..62
modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts on lines 48..53

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

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

  text = {
    title: this.I18n.t('js.work_packages.create.title'),
    createWithDropdown: this.I18n.t('js.work_packages.create.button'),
    createButton: this.I18n.t('js.label_work_package'),
    explanation: this.I18n.t('js.label_create_work_package'),
frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts on lines 96..101
frontend/src/app/features/projects/components/new-project/new-project.component.ts on lines 38..43
frontend/src/app/features/user-preferences/reminder-settings/pause-reminders/pause-reminders.component.ts on lines 30..35
frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts on lines 71..76
frontend/src/app/features/work-packages/components/wp-activity/user/user-activity.component.ts on lines 94..99
frontend/src/app/features/work-packages/components/wp-baseline/baseline-legends/baseline-legends.component.ts on lines 81..86
frontend/src/app/features/work-packages/components/wp-baseline/baseline-modal/baseline-modal.component.ts on lines 46..52
frontend/src/app/features/work-packages/components/wp-breadcrumb/wp-breadcrumb-parent.component.ts on lines 48..53
frontend/src/app/features/work-packages/components/wp-timer-button/wp-timer-button.component.ts on lines 81..86
frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts on lines 18..23
frontend/src/app/shared/components/modals/share-modal/query-sharing-form.component.ts on lines 27..33
frontend/src/app/shared/components/table-pagination/table-pagination.component.ts on lines 63..68
frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts on lines 55..60
frontend/src/app/shared/components/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts on lines 42..48
modules/github_integration/frontend/module/pull-request/pull-request.component.ts on lines 57..62
modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts on lines 48..53

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

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

Severity
Category
Status
Source
Language