opf/openproject

View on GitHub

Showing 610 of 1,650 total issues

OpWpMultiDateFormComponent has 44 functions (exceeds 20 allowed). Consider refactoring.
Open

@Component({
  selector: 'op-wp-multi-date-form',
  templateUrl: './wp-multi-date-form.component.html',
  styleUrls: [
    '../styles/datepicker.modal.sass',

    Function buildItems has 148 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function Model has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

      RB.Model = (function ($) {
        return RB.Object.create({
      
          initialize: function (el) {
            this.$ = $(el);
      Severity: Minor
      Found in frontend/src/stimulus/controllers/dynamic/backlogs/model.js - About 5 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 initializeHalProperties has 141 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function initializeHalProperties<T extends HalResource>(halResourceService:HalResourceService, halResource:T) {
        setSource();
        setupLinks();
        setupEmbedded();
        proxyProperties();
      Severity: Major
      Found in frontend/src/app/features/hal/helpers/hal-resource-builder.ts - About 5 hrs to fix

        File board-list.component.ts has 401 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {
          ChangeDetectionStrategy,
          ChangeDetectorRef,
          Component,
          ElementRef,

          File op-autocompleter.component.ts has 396 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* We just forward the ng-select outputs without renaming */
          /* eslint-disable @angular-eslint/no-output-native */
          import {
            AfterViewInit,
            ChangeDetectionStrategy,

            OpAutocompleterComponent has 40 functions (exceeds 20 allowed). Consider refactoring.
            Open

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

              File wp-calendar.component.ts has 387 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

                File set_attributes_service.rb has 380 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class WorkPackages::SetAttributesService < BaseServices::SetAttributes
                  include Attachments::SetReplacements
                
                  private
                
                
                Severity: Minor
                Found in app/services/work_packages/set_attributes_service.rb - About 5 hrs to fix

                  Method check has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def check(pop_options = {}, options = {})
                          host = pop_options[:host] || "127.0.0.1"
                          port = pop_options[:port] || "110"
                          apop = (pop_options[:apop].to_s == "1")
                          delete_unprocessed = (pop_options[:delete_unprocessed].to_s == "1")
                  Severity: Minor
                  Found in lib/redmine/pop3.rb - About 5 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 GroupBys has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Reporting.GroupBys = (function($){
                    var group_by_container_ids = function() {
                      var ids = ['group-by--columns', 'group-by--rows'];
                  
                      return _.filter(ids, function (i) {

                    Function Taskboard has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    RB.Taskboard = (function ($) {
                      return RB.Object.create(RB.Model, {
                    
                        initialize: function (el) {
                          var self = this; // So we can bind the event handlers to this object
                    Severity: Major
                    Found in frontend/src/stimulus/controllers/dynamic/backlogs/taskboard.js - About 4 hrs to fix

                      File multi-date-picker.component.ts has 366 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

                        Class BaseActivityProvider has 36 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Activities::BaseActivityProvider
                          include I18n
                          include Redmine::I18n
                          include OpenProject::StaticRouting
                        
                        
                        Severity: Minor
                        Found in app/models/activities/base_activity_provider.rb - About 4 hrs to fix

                          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,

                                  Function initializeCalendar has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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

                                    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: [
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language