opf/openproject

View on GitHub

Showing 1,603 of 1,617 total issues

GridAreaService has 36 functions (exceeds 20 allowed). Consider refactoring.
Open

@Injectable()
export class GridAreaService {
  private resource:GridResource;

  public schema:SchemaResource;
Severity: Minor
Found in frontend/src/app/shared/components/grids/grid/area.service.ts - About 4 hrs to fix

    TimeEntryCalendarComponent has 36 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Component({
      templateUrl: './te-calendar.template.html',
      styleUrls: ['./te-calendar.component.sass'],
      selector: 'op-time-entries-calendar',
      encapsulation: ViewEncapsulation.None,

      File dynamic-fields.service.ts has 361 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { Injectable } from '@angular/core';
      import { FormlyFieldConfig } from '@ngx-formly/core';
      import { Observable, of } from 'rxjs';
      import { map } from 'rxjs/operators';
      import { HttpClient } from '@angular/common/http';

        File op-work-packages-calendar.service.ts has 360 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Injectable, Injector } from '@angular/core';
        import {
          CalendarOptions,
          DatesSetArg,
          DayCellContentArg,

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

              it('should have a callable self link', () => {
                spyOn(halResourceService, 'request').and.callFake((verb:string, path:string) => {
                  if (verb === 'get' && path === 'unicorn/69') {
                    return of(halResourceService.createHalResource({})) as any;
                  }
          Severity: Major
          Found in frontend/src/app/features/hal/resources/hal-resource.spec.ts and 1 other location - About 4 hrs to fix
          frontend/src/app/features/hal/resources/hal-resource.spec.ts on lines 389..398

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

          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

              it('should have a callable beaver', () => {
                spyOn(halResourceService, 'request').and.callFake((verb:string, path:string) => {
                  if (verb === 'get' && path === 'justin/420') {
                    return of(halResourceService.createHalResource({})) as any;
                  }
          Severity: Major
          Found in frontend/src/app/features/hal/resources/hal-resource.spec.ts and 1 other location - About 4 hrs to fix
          frontend/src/app/features/hal/resources/hal-resource.spec.ts on lines 378..387

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

          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

          GlobalSearchInputComponent has 35 functions (exceeds 20 allowed). Consider refactoring.
          Open

          @Component({
            selector: 'opce-global-search',
            changeDetection: ChangeDetectionStrategy.OnPush,
            templateUrl: './global-search-input.component.html',
            styleUrls: [

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

              public text = {
                search: this.I18n.t('js.global_search.search'),
                label: this.I18n.t('js.toolbar.search_query_label'),
                scope_default: this.I18n.t('js.label_default_queries'),
                scope_starred: this.I18n.t('js.label_starred_queries'),
            frontend/src/app/features/work-packages/components/filters/query-filter/query-filter.component.ts on lines 80..88

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

            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 = {
                open_filter: this.I18n.t('js.filter.description.text_open_filter'),
                close_filter: this.I18n.t('js.filter.description.text_close_filter'),
                label_filter_add: this.I18n.t('js.work_packages.label_filter_add'),
                upsale_for_more: this.I18n.t('js.filter.upsale_for_more'),
            frontend/src/app/shared/components/op-view-select/op-view-select.component.ts on lines 66..74

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

            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

                for (const [start, end] of inViewportAndBoundaries) {
                  const cell = this.addLabelCell();
                  cell.style.top = `${marginTop}px`;
                  cell.style.left = calculatePositionValueForDayCount(vp, start.diff(startView, 'days'));
                  cell.style.width = calculatePositionValueForDayCount(vp, end.diff(start, 'days') + 1);
            frontend/src/app/features/work-packages/components/wp-table/timeline/header/wp-timeline-header.directive.ts on lines 214..220

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

            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

                  for (const [start, end] of rest) {
                    const cell = this.addLabelCell();
                    cell.style.top = `${marginTop}px`;
                    cell.style.left = calculatePositionValueForDayCount(vp, start.diff(startView, 'days'));
                    cell.style.width = calculatePositionValueForDayCount(vp, end.diff(start, 'days') + 1);
            frontend/src/app/features/work-packages/components/wp-table/timeline/header/wp-timeline-header.directive.ts on lines 206..212

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

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

              private initializeCalendar() {
                void this.weekdayService.loadWeekdays()
                  .toPromise()
                  .then(() => {
                    this.calendarOptions$.next(

              File url-params-helper.ts has 347 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

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

                  public parseBegin(date:string|null) {
                    if (date === null || !validDate(date)) {
                      return;
                    }
                
                
                frontend/src/app/features/work-packages/components/filters/filter-date-times-value/filter-date-times-value.component.ts on lines 123..139

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

                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 parseEnd(date:string|null) {
                    if (date === null || !validDate(date)) {
                      return;
                    }
                
                
                frontend/src/app/features/work-packages/components/filters/filter-date-times-value/filter-date-times-value.component.ts on lines 105..121

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

                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

                File global-search-input.component.ts has 345 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

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

                      this.entryLocation()
                        .pipe(
                          this.untilDestroyed(),
                          switchMap((location:string) => this.storageFilesResourceService.files(makeFilesCollectionLink(this.storage._links.self, location))),
                        )
                  frontend/src/app/shared/components/storages/file-picker-base-modal/file-picker-base-modal.component.ts on lines 155..168

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

                  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

                      this.loadingSubscription = this.storageFilesResourceService
                        .files(makeFilesCollectionLink(this.storage._links.self, ancestor.location))
                        .subscribe({
                          next: (storageFiles) => {
                            this.currentDirectory = storageFiles.parent;
                  frontend/src/app/shared/components/storages/file-picker-base-modal/file-picker-base-modal.component.ts on lines 112..128

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

                  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

                  Class CostQuery has 33 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class CostQuery < ApplicationRecord
                    extend Forwardable
                    include Enumerable
                    include Engine
                  
                  
                  Severity: Minor
                  Found in modules/reporting/app/models/cost_query.rb - About 4 hrs to fix

                    WorkPackageTimelineTableController has 33 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    @Component({
                      selector: 'wp-timeline-container',
                      templateUrl: './wp-timeline-container.html',
                    })
                    export class WorkPackageTimelineTableController extends UntilDestroyedMixin implements AfterViewInit {
                      Severity
                      Category
                      Status
                      Source
                      Language