opf/openproject

View on GitHub

Showing 610 of 1,650 total issues

File area.service.ts has 311 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Injectable } from '@angular/core';
import { GridWidgetArea } from 'core-app/shared/components/grids/areas/grid-widget-area';
import { GridArea } from 'core-app/shared/components/grids/areas/grid-area';
import { GridGap } from 'core-app/shared/components/grids/areas/grid-gap';
import { GridResource } from 'core-app/features/hal/resources/grid-resource';
Severity: Minor
Found in frontend/src/app/shared/components/grids/grid/area.service.ts - About 3 hrs to fix

    Function Controls has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Reporting.Controls = function($){
      var toggle_delete_form = function (e) {
        e.preventDefault();
    
        var offset = $('#query-icon-delete').offsetLeft;

      WorkPackageViewFiltersService has 28 functions (exceeds 20 allowed). Consider refactoring.
      Open

      @Injectable()
      export class WorkPackageViewFiltersService extends WorkPackageQueryStateService<QueryFilterInstanceResource[]> {
        public hidden:string[] = [
          'datesInterval',
          'precedes',

        WorkPackageViewColumnsService has 28 functions (exceeds 20 allowed). Consider refactoring.
        Open

        @Injectable()
        export class WorkPackageViewColumnsService extends WorkPackageQueryStateService<QueryColumn[]> {
          public constructor(readonly states:States, readonly querySpace:IsolatedQuerySpace) {
            super(querySpace);
          }

          TimelineCellRenderer has 28 functions (exceeds 20 allowed). Consider refactoring.
          Open

          export class TimelineCellRenderer {
            @InjectField() wpTableTimeline:WorkPackageViewTimelineService;
          
            @InjectField() weekdayService:WeekdayService;
          
          

            OpWorkPackagesCalendarService has 28 functions (exceeds 20 allowed). Consider refactoring.
            Open

            @Injectable()
            export class OpWorkPackagesCalendarService extends UntilDestroyedMixin {
              static MAX_DISPLAYED = 500;
            
              tooManyResultsText:string|null;

              Function RestoreQuery has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

              Reporting.RestoreQuery = function($){
              
                var select_operator = function (field, operator) {
                  var select, i;
                  select = $("#operators_" + field);

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method update has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                def update
                  # TODO: copied over from edit
                  # remove code where appropriate
                  if @project
                    # Hourly Rate
              Severity: Minor
              Found in modules/costs/app/controllers/hourly_rates_controller.rb - About 3 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method lcs has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                def self.lcs(a, b)
                  astart = 0
                  bstart = 0
                  afinish = a.length - 1
                  bfinish = b.length - 1
              Severity: Minor
              Found in lib_static/redmine/diff/array_string_diff.rb - About 3 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function renderRelation has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                private renderRelation(vp:TimelineViewParameters,
                  e:TimelineRelationElement,
                  idxFrom:number,
                  idxTo:number,
                  startCell:WorkPackageTimelineCell,

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function initializeCalendar has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                private initializeCalendar() {
                  const additionalOptions:{ [key:string]:unknown } = {
                    locales: allLocales,
                    locale: this.I18n.locale,
                    height: '100%',

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method up has 80 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def up
                  Migration::MigrationSquasher.squash(migrations) do
                    create_table "cost_entries", id: :integer do |t|
                      t.integer "user_id",                                                            null: false
                      t.integer "project_id",                                                         null: false

                Class TableComponent has 27 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class TableComponent < ApplicationComponent
                  def initialize(rows: [], **options)
                    super(rows, **options)
                  end
                
                
                Severity: Minor
                Found in app/components/table_component.rb - About 3 hrs to fix

                  Class Results has 27 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class ::Query::Results
                    include ::Query::Results::GroupBy
                    include ::Query::Results::Sums
                    include Redmine::I18n
                  
                  
                  Severity: Minor
                  Found in app/models/query/results.rb - About 3 hrs to fix

                    Class Budget has 27 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Budget < ApplicationRecord
                      belongs_to :author, class_name: "User"
                      belongs_to :project
                      has_many :work_packages, dependent: :nullify
                      has_many :material_budget_items, -> {
                    Severity: Minor
                    Found in modules/budgets/app/models/budget.rb - About 3 hrs to fix

                      Class CreateContract has 27 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                          class CreateContract < ::ModelContract
                            include ::Bim::Bcf::Concerns::ManageBcfGuarded
                      
                            WHITELISTED_PROPERTIES = %w(guid
                                                        index
                      Severity: Minor
                      Found in modules/bim/app/contracts/bim/bcf/viewpoints/create_contract.rb - About 3 hrs to fix

                        Method controller_work_package_new_after_save has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def controller_work_package_new_after_save(context = {})
                              params = context[:params]
                              work_package = context[:work_package]
                        
                              return unless work_package.backlogs_enabled?
                        Severity: Minor
                        Found in modules/backlogs/lib/open_project/backlogs/hooks/layout_hook.rb - About 3 hrs to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Method update has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def update
                            wiki_menu_setting = wiki_menu_item_params[:setting]
                            parent_wiki_menu_item = params[:parent_wiki_menu_item]
                        
                            get_data_from_params(params)
                        Severity: Minor
                        Found in app/controllers/wiki_menu_items_controller.rb - About 3 hrs to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function selectPreviousResult has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                        Open

                          private selectPreviousResult(activeID:ID|null, allProjects:IProjectData[]):void {
                            if (activeID === null) {
                              return;
                            }
                        
                        

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function buildItems has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                        Open

                          private buildItems() {
                            this.items = [
                              {
                                // Configuration modal
                                disabled: false,

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Severity
                        Category
                        Status
                        Source
                        Language