opf/openproject

View on GitHub

Showing 1,735 of 1,766 total issues

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

  public text = {
    open_filter: this.I18n.t('js.filter.description.text_open_filter'),
    label_filter_add: this.I18n.t('js.work_packages.label_filter_add'),
    close_filter: this.I18n.t('js.filter.description.text_close_filter'),
    upsale_for_more: this.I18n.t('js.filter.upsale_for_more'),
frontend/src/app/core/setup/globals/components/admin/backup.component.ts on lines 54..65
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

Class Query has 50 methods (exceeds 20 allowed). Consider refactoring.
Open

class Query < ApplicationRecord
  include Timelines
  include Highlighting
  include ManualSorting
  include Queries::Filters::AvailableFilters
Severity: Minor
Found in app/models/query.rb - About 7 hrs to fix

    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

      Method define_operators has 172 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.define_operators # :nodoc:
          # Defaults
          defaults do
            def_delegators :singleton_class, :forced?, :force!, :forced
      
      
      Severity: Major
      Found in modules/reporting/lib/report/operator.rb - About 6 hrs to fix

        Class ApplicationController has 49 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class ApplicationController < ActionController::Base
          class_attribute :_model_object
          class_attribute :_model_scope
          class_attribute :accept_key_auth_actions
        
        
        Severity: Minor
        Found in app/controllers/application_controller.rb - About 6 hrs to fix

          File mail_handler.rb has 449 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class MailHandler < ActionMailer::Base
            include ActionView::Helpers::SanitizeHelper
            include Redmine::I18n
          
            class UnauthorizedAction < StandardError; end
          Severity: Minor
          Found in app/models/mail_handler.rb - About 6 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';

              File work_package.rb has 439 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              class WorkPackage < ApplicationRecord
                include WorkPackage::Validations
                include WorkPackage::SchedulingRules
                include WorkPackage::StatusTransitions
                include WorkPackage::AskBeforeDestruction
              Severity: Minor
              Found in app/models/work_package.rb - About 6 hrs to fix

                Class MailHandler has 47 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class MailHandler < ActionMailer::Base
                  include ActionView::Helpers::SanitizeHelper
                  include Redmine::I18n
                
                  class UnauthorizedAction < StandardError; end
                Severity: Minor
                Found in app/models/mail_handler.rb - About 6 hrs to fix

                  Class BaseContract has 46 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                    class BaseContract < ::ModelContract
                      include ::Attachments::ValidateReplacements
                      include AssignableValuesContract
                  
                      attribute :subject
                  Severity: Minor
                  Found in app/contracts/work_packages/base_contract.rb - About 6 hrs to fix

                    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 2 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

                      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 2 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

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

                            {
                              // Sort ascending
                              hidden: !this.wpTableSortBy.isSortable(c),
                              linkText: this.I18n.t('js.work_packages.query.sort_descending'),
                              icon: 'icon-sort-descending',
                      frontend/src/app/shared/components/op-context-menu/handlers/op-columns-context-menu.directive.ts on lines 134..152

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

                      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

                            {
                              // Sort descending
                              hidden: !this.wpTableSortBy.isSortable(c),
                              linkText: this.I18n.t('js.work_packages.query.sort_ascending'),
                              icon: 'icon-sort-ascending',
                      frontend/src/app/shared/components/op-context-menu/handlers/op-columns-context-menu.directive.ts on lines 115..133

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

                      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

                      xdescribe('ProjectsComponent', () => {
                        let component:ProjectsComponent;
                        let fixture:ComponentFixture<ProjectsComponent>;
                      
                        beforeEach(async () => {
                      frontend/src/app/shared/components/dynamic-forms/components/dynamic-inputs/date-input/date-input.component.spec.ts on lines 5..25
                      frontend/src/app/shared/components/dynamic-forms/components/dynamic-inputs/formattable-textarea-input/components/formattable-control/formattable-control.component.spec.ts on lines 5..25

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

                      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

                      xdescribe('FormattableControlComponent', () => {
                        let component:FormattableControlComponent;
                        let fixture:ComponentFixture<FormattableControlComponent>;
                      
                        beforeEach(async () => {
                      frontend/src/app/features/projects/components/projects/projects.component.spec.ts on lines 5..25
                      frontend/src/app/shared/components/dynamic-forms/components/dynamic-inputs/date-input/date-input.component.spec.ts on lines 5..25

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

                      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

                      xdescribe('DateInputComponent', () => {
                        let component:DateInputComponent;
                        let fixture:ComponentFixture<DateInputComponent>;
                      
                        beforeEach(async () => {
                      frontend/src/app/features/projects/components/projects/projects.component.spec.ts on lines 5..25
                      frontend/src/app/shared/components/dynamic-forms/components/dynamic-inputs/formattable-textarea-input/components/formattable-control/formattable-control.component.spec.ts on lines 5..25

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

                      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