opf/openproject

View on GitHub

Showing 620 of 1,668 total issues

Function registerWorkPackageMouseHandler has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

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

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 buildV3GetQueryFromJsonParams has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  public buildV3GetQueryFromJsonParams(updateJson:string|null) {
    const queryData:Partial<QueryRequestParams> = {
      pageSize: this.paginationService.getPerPage(),
    };

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

BoardListComponent has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

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

    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;

      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);
        }

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

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

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

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

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

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

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

              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

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

                        Function initializeUiRouterListeners has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function initializeUiRouterListeners(injector:Injector) {
                          const $transitions:TransitionService = injector.get(TransitionService);
                          const stateService = injector.get(StateService);
                          const toastService:ToastService = injector.get(ToastService);
                          const currentProject:CurrentProjectService = injector.get(CurrentProjectService);
                        Severity: Major
                        Found in frontend/src/app/core/routing/openproject.routes.ts - About 3 hrs to fix

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language