opf/openproject

View on GitHub

Showing 1,735 of 1,766 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_planner?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

Class PermittedParams has 56 methods (exceeds 20 allowed). Consider refactoring.
Open

class PermittedParams
  # This class intends to provide a method for all params hashes coming from the
  # client and that are used for mass assignment.
  #
  # A method should look like the following:
Severity: Major
Found in app/models/permitted_params.rb - About 1 day to fix

    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

    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

    Method permitted_attributes has 194 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.permitted_attributes
        @whitelisted_params ||= begin
          params = {
            attribute_help_text: %i(
              type
    Severity: Major
    Found in app/models/permitted_params.rb - About 7 hrs to fix

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

        public text:any = {
          title: this.I18n.t('js.boards.add_list'),
          button_add: this.I18n.t('js.button_add'),
          button_create: this.I18n.t('js.button_create'),
          button_cancel: this.I18n.t('js.button_cancel'),
      frontend/src/app/shared/components/datepicker/datepicker.modal.ts on lines 78..90

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

      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 = {
          save: this.I18n.t('js.button_save'),
          cancel: this.I18n.t('js.button_cancel'),
          clear: this.I18n.t('js.work_packages.button_clear'),
          manualScheduling: this.I18n.t('js.scheduling.manual'),
      frontend/src/app/features/boards/board/add-list-modal/add-list-modal.component.ts on lines 94..108

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

      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 user.rb has 489 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'digest/sha1'
      
      class User < Principal
        USER_FORMATS_STRUCTURE = {
          firstname_lastname: %i[firstname lastname],
      Severity: Minor
      Found in app/models/user.rb - About 7 hrs to fix

        Class Chainable has 54 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class Chainable
            include Enumerable
            include Report::QueryUtils
            extend Report::InheritedAttribute
            extend Forwardable
        Severity: Major
        Found in modules/reporting/lib/report/chainable.rb - About 7 hrs to fix

          File te-calendar.component.ts has 480 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
            ChangeDetectionStrategy,
            Component,
            ElementRef,
            EventEmitter,

            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

              File work_package_representer.rb has 475 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module API
                module V3
                  module WorkPackages
                    class WorkPackageRepresenter < ::API::Decorators::Single
                      include API::Decorators::LinkedResource
              Severity: Minor
              Found in lib/api/v3/work_packages/work_package_representer.rb - About 7 hrs to fix

                File permitted_params.rb has 473 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'permitted_params/allowed_settings'
                
                class PermittedParams
                  # This class intends to provide a method for all params hashes coming from the
                  # client and that are used for mass assignment.
                Severity: Minor
                Found in app/models/permitted_params.rb - About 7 hrs to fix

                  Class Repository has 52 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Repository < ApplicationRecord
                    include Redmine::Ciphering
                    include OpenProject::SCM::ManageableRepository
                  
                    belongs_to :project
                  Severity: Major
                  Found in app/models/repository.rb - About 7 hrs to fix

                    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 text:any = {
                        title: this.I18n.t('js.boards.add_list'),
                        button_add: this.I18n.t('js.button_add'),
                        button_cancel: this.I18n.t('js.button_cancel'),
                        close_popup: this.I18n.t('js.close_popup_title'),
                    frontend/src/app/features/boards/new-board-modal/new-board-modal.component.ts on lines 59..72

                    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 text:any = {
                        close_popup: this.I18n.t('js.close_popup_title'),
                    
                        free_board: this.I18n.t('js.boards.board_type.free'),
                        free_board_text: this.I18n.t('js.boards.board_type.free_text'),
                    frontend/src/app/features/boards/add-list-modal/add-list-modal.component.ts on lines 88..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 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 3 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
                    frontend/src/app/features/work-packages/components/filters/query-filters/query-filters.component.ts on lines 68..79

                    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 3 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
                    frontend/src/app/features/work-packages/components/filters/query-filters/query-filters.component.ts on lines 68..79

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language