opf/openproject

View on GitHub

Showing 620 of 1,668 total issues

File team-planner.component.ts has 820 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

    Function Filters has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
    Open

    Reporting.Filters = function($){
      var load_available_values_for_filter = function  (filter_name, callback_func) {
        var select, radio_options, post_select_values;
        select = $('.filter-value[data-filter-name="' + filter_name + '"]').first();
        // check if we might have a radio-box

    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 Model has 329 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    RB.Model = (function ($) {
      return RB.Object.create({
    
        initialize: function (el) {
          this.$ = $(el);
    Severity: Major
    Found in frontend/src/stimulus/controllers/dynamic/backlogs/model.js - About 1 day to fix

      Class GanttBuilder has 75 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class GanttBuilder
          include Redmine::I18n
          BAR_CELL_PADDING = 5.to_f
          TEXT_CELL_PADDING_H = 3.to_f
          TEXT_CELL_PADDING_V = 1.to_f
      Severity: Major
      Found in app/models/work_package/pdf_export/gantt/gantt_builder.rb - About 1 day to fix

        File hal-resource.spec.ts has 618 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
        Severity: Major
        Found in frontend/src/app/features/hal/resources/hal-resource.spec.ts - About 1 day to fix

          File openproject-work-packages.module.ts has 607 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 wp-multi-date-form.component.ts has 558 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 SetAttributesService has 64 methods (exceeds 20 allowed). Consider refactoring.
              Open

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

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

                import {
                  ChangeDetectionStrategy,
                  Component,
                  ElementRef,
                  EventEmitter,

                  Method static_links has 227 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def static_links
                            {
                              upsale: {
                                href: "https://www.openproject.org/enterprise-edition",
                                label: "homescreen.links.upgrade_enterprise_edition"
                  Severity: Major
                  Found in lib/open_project/static/links.rb - About 1 day to fix

                    File gantt_builder.rb has 521 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    module WorkPackage::PDFExport::Gantt
                      class GanttBuilder
                        include Redmine::I18n
                        BAR_CELL_PADDING = 5.to_f
                        TEXT_CELL_PADDING_H = 3.to_f
                    Severity: Major
                    Found in app/models/work_package/pdf_export/gantt/gantt_builder.rb - About 1 day to fix

                      Class PDFStyles has 59 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class PDFStyles
                          include MarkdownToPDF::Common
                          include MarkdownToPDF::StyleHelper
                      
                          def initialize(yml)
                      Severity: Major
                      Found in app/models/work_package/pdf_export/style.rb - About 1 day to fix

                        PathHelperService has 59 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        @Injectable({ providedIn: 'root' })
                        export class PathHelperService {
                          public readonly appBasePath = window.appBasePath || '';
                        
                          public readonly api = {
                        Severity: Major
                        Found in frontend/src/app/core/path-helper/path-helper.service.ts - About 1 day to fix

                          Function Filters has 210 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          Reporting.Filters = function($){
                            var load_available_values_for_filter = function  (filter_name, callback_func) {
                              var select, radio_options, post_select_values;
                              select = $('.filter-value[data-filter-name="' + filter_name + '"]').first();
                              // check if we might have a radio-box

                            Function registerWidgets has 195 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 storage.component.ts has 475 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 dynamic-form.component.spec.ts has 461 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,

                                  Method modify_conditions has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def modify_conditions(node)
                                      if node.kind_of? Arel::TreeManager
                                        # We have another sub-tree, investigate its core, which is a SelectCore
                                        node.instance_variable_get(:@ast).instance_variable_get(:@cores).each do |core|
                                          modify_conditions(core)
                                  Severity: Minor
                                  Found in app/models/journable/historic_active_record_relation.rb - About 6 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

                                  File wp-timeline-container.directive.ts has 442 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

                                    TeamPlannerComponent has 47 functions (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    @Component({
                                      selector: 'op-team-planner',
                                      templateUrl: './team-planner.component.html',
                                      styleUrls: ['./team-planner.component.sass'],
                                      changeDetection: ChangeDetectionStrategy.OnPush,
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language