opf/openproject

View on GitHub

Showing 1,417 of 1,434 total issues

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

export const TEAM_PLANNER_ROUTES:Ng2StateDeclaration[] = [
  {
    name: 'team_planner',
    parent: 'optional_project',
    url: '/team_planners/:query_id?query_props&cdate&cview',
frontend/src/app/features/calendar/calendar.routes.ts on lines 36..75

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

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

export class ApiV3StatusesPaths extends ApiV3ResourceCollection<StatusResource, ApiV3StatusPaths> {
  constructor(protected apiRoot:ApiV3Service,
    protected basePath:string) {
    super(apiRoot, basePath, 'statuses', ApiV3StatusPaths);
  }
frontend/src/app/core/apiv3/endpoints/roles/apiv3-roles-paths.ts on lines 37..58

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

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

export class ApiV3RolesPaths extends ApiV3ResourceCollection<RoleResource, ApiV3RolePaths> {
  constructor(protected apiRoot:ApiV3Service,
    protected basePath:string) {
    super(apiRoot, basePath, 'roles', ApiV3RolePaths);
  }
frontend/src/app/core/apiv3/endpoints/statuses/apiv3-statuses-paths.ts on lines 37..58

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

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 registerWidgets has 187 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function registerWidgets(injector:Injector) {
  const hookService = injector.get(HookService);
  const i18n = injector.get(I18nService);

  hookService.register('gridWidgets', () => {
Severity: Major
Found in frontend/src/app/shared/components/grids/openproject-grids.module.ts - About 7 hrs to fix

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

      constructor(
        protected states:States,
        protected querySpace:IsolatedQuerySpace,
        protected wpTableColumns:WorkPackageViewColumnsService,
        protected wpTableGroupBy:WorkPackageViewGroupByService,
    frontend/src/app/features/calendar/op-work-packages-calendar.service.ts on lines 80..103

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

    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

      constructor(
        private I18n:I18nService,
        private configuration:ConfigurationService,
        private sanitizer:DomSanitizer,
        private $state:StateService,
    frontend/src/app/features/work-packages/components/wp-list/wp-states-initialization.service.ts on lines 31..52

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

    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

      public configureWorkPackageButton(typeName?:string, classes?:string):Promise<{ type:string, classes:string }> {
        return new Promise<{ type:string, classes:string }>((resolve, reject) => {
          const modal = this.opModalService.show(WpButtonMacroModalComponent, this.injector, { type: typeName, classes });
          modal.closingEvent.subscribe((modal:WpButtonMacroModalComponent) => {
            if (modal.changed) {
    frontend/src/app/shared/components/modals/editor/editor-macros.service.ts on lines 77..86

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

    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

      public editCodeBlock(content:string, languageClass:string):Promise<{ content:string, languageClass:string }> {
        return new Promise<{ content:string, languageClass:string }>((resolve, _) => {
          const modal = this.opModalService.show(CodeBlockMacroModalComponent, this.injector, { content, languageClass });
          modal.closingEvent.subscribe((modal:CodeBlockMacroModalComponent) => {
            if (modal.changed) {
    frontend/src/app/shared/components/modals/editor/editor-macros.service.ts on lines 46..55

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

    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

      text = {
        title: this.I18n.t('js.reminders.settings.alerts.title'),
        explanation: this.I18n.t('js.reminders.settings.alerts.explanation'),
        newsAdded: this.I18n.t('js.reminders.settings.alerts.news_added'),
        newsCommented: this.I18n.t('js.reminders.settings.alerts.news_commented'),
    frontend/src/app/core/setup/globals/components/admin/backup.component.ts on lines 54..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 176.

    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

      public text = {
        info: this.i18n.t('js.backup.info'),
        note: this.i18n.t('js.backup.note'),
        title: this.i18n.t('js.backup.title'),
        lastBackup: this.i18n.t('js.backup.last_backup'),
    frontend/src/app/features/user-preferences/reminder-settings/email-alerts/email-alerts-settings.component.ts on lines 38..49

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

    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

    PathHelperService has 50 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Injectable({ providedIn: 'root' })
    export class PathHelperService {
      public readonly appBasePath = window.appBasePath || '';
    
      public readonly api = {
    Severity: Minor
    Found in frontend/src/app/core/path-helper/path-helper.service.ts - About 7 hrs to fix

      File dynamic-form.component.spec.ts has 444 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { NgSelectModule } from '@ng-select/ng-select';
      import { NgOptionHighlightModule } from '@ng-select/ng-option-highlight';
      import { Component, forwardRef, ViewChild } from '@angular/core';
      import { ComponentFixture, fakeAsync, flush, TestBed } from '@angular/core/testing';
      import { By } from '@angular/platform-browser';

        Method static_links has 164 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def static_links
                  {
                    upsale: {
                      href: 'https://www.openproject.org/enterprise-edition',
                      label: 'homescreen.links.upgrade_enterprise_edition'
        Severity: Major
        Found in lib/open_project/static/links.rb - About 6 hrs to fix

          TeamPlannerComponent has 47 functions (exceeds 20 allowed). Consider refactoring.
          Open

          @Component({
            selector: 'op-team-planner',
            templateUrl: './team-planner.component.html',
            styleUrls: ['./team-planner.component.sass'],
            changeDetection: ChangeDetectionStrategy.OnPush,

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

              create() {
                this.inFlight = true;
                this.actionService
                  .addColumnWithActionAttribute(this.board, this.selectedAttribute!)
                  .then((board) => this.boardService.save(board).toPromise())
            frontend/src/app/features/boards/add-list-modal/add-list-modal.component.ts on lines 170..181

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

            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

              create() {
                this.inFlight = true;
                this.actionService
                  .addColumnWithActionAttribute(this.board, this.selectedAttribute!)
                  .then((board) => this.boardService.save(board).toPromise())
            frontend/src/app/features/boards/board/add-list-modal/add-list-modal.component.ts on lines 138..149

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

            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 registerWorkPackageMouseHandler has 155 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function registerWorkPackageMouseHandler(this:void,
              injector:Injector,
              getRenderInfo:() => RenderInfo,
              workPackageTimeline:WorkPackageTimelineTableController,
              halEditing:HalResourceEditingService,

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

                public text = {
                  toggle_title: this.I18n.t('js.include_projects.toggle_title'),
                  title: this.I18n.t('js.include_projects.title'),
                  filter_all: this.I18n.t('js.include_projects.selected_filter.all'),
                  filter_selected: this.I18n.t('js.include_projects.selected_filter.selected'),
              frontend/src/app/features/enterprise/enterprise-base.component.ts on lines 43..53
              frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.ts on lines 50..62

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

              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

                public text = {
                  button_trial: this.I18n.t('js.admin.enterprise.upsale.button_start_trial'),
                  button_book: this.I18n.t('js.admin.enterprise.upsale.button_book_now'),
                  link_quote: this.I18n.t('js.admin.enterprise.upsale.link_quote'),
                  become_hero: this.I18n.t('js.admin.enterprise.upsale.become_hero'),
              frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.ts on lines 50..62
              frontend/src/app/shared/components/project-include/project-include.component.ts on lines 49..59

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

              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

                public text = {
                  title: this.I18n.t('js.work_packages.table_configuration.modal_title'),
                  closePopup: this.I18n.t('js.close_popup_title'),
              
                  columnsLabel: this.I18n.t('js.label_columns'),
              frontend/src/app/features/enterprise/enterprise-base.component.ts on lines 43..53
              frontend/src/app/shared/components/project-include/project-include.component.ts on lines 49..59

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

              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