opf/openproject

View on GitHub

Showing 620 of 1,668 total issues

HalResource has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

export class HalResource {
  // TODO this is the source of many issues in the frontend
  // because it no longer properly type checks stuff
  // Since 2019-10-21 I'm documenting what bugs this caused:
  // https://community.openproject.com/wp/31462
Severity: Minor
Found in frontend/src/app/features/hal/resources/hal-resource.ts - About 2 hrs to fix

    IanCenterService has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Injectable()
    @EffectHandler
    export class IanCenterService extends UntilDestroyedMixin {
      readonly id = 'ian-center';
    
    

      WorkPackagesListService has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      @Injectable()
      export class WorkPackagesListService {
        @InjectField() protected readonly currentUser:CurrentUserService;
      
        // We remember the query requests coming in so we can ensure only the latest request is being tended to

        ConfigurationService has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        @Injectable({ providedIn: 'root' })
        export class ConfigurationService {
          // fetches configuration from the ApiV3 endpoint
          // TODO: this currently saves the request between page reloads,
          // but could easily be stored in localStorage
        Severity: Minor
        Found in frontend/src/app/core/config/configuration.service.ts - About 2 hrs to fix

          Function buildV3GetQueryFromJsonParams has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function toggleFormat has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              private toggleFormat(format:string) {
                // defaults (reset these fields before doing anything else)
                this.activate(this.defaultBoolTargets, false);
                this.activate(this.defaultLongTextTargets, false);
                this.activate(this.multiSelectTargets, false);

              Function initialize has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                private initialize():void {
                  combineLatest([
                    this.wpTableSortBy.onReadyWithAvailable(),
                    this.wpTableSortBy.live$(),
                  ])

                Method initialize has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                    def initialize(diff, options = {})
                      options.assert_valid_keys(:type, :max_lines)
                      diff = diff.split("\n") if diff.is_a?(String)
                      @diff_type = options[:type] || "inline"
                      lines = 0
                Severity: Minor
                Found in lib/redmine/unified_diff.rb - About 2 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-create.service.ts has 273 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 filters.js has 272 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 Task has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    RB.Task = (function ($) {
                      return RB.Object.create(RB.WorkPackage, {
                    
                        initialize: function (el) {
                          this.$ = $(el);
                    Severity: Major
                    Found in frontend/src/stimulus/controllers/dynamic/backlogs/task.js - About 2 hrs to fix

                      Class Version has 23 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Version < ApplicationRecord
                        include ::Versions::ProjectSharing
                        include ::Scopes::Scoped
                      
                        belongs_to :project
                      Severity: Minor
                      Found in app/models/version.rb - About 2 hrs to fix

                        Class Base has 23 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                              class Base
                                include CheckoutInstructions
                        
                                attr_accessor :url, :root_url
                        
                        
                        Severity: Minor
                        Found in lib/open_project/scm/adapters/base.rb - About 2 hrs to fix

                          FiltersController has 23 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          export default class FiltersController extends Controller {
                            static targets = [
                              'filterFormToggle',
                              'filterForm',
                              'filter',
                          Severity: Minor
                          Found in frontend/src/stimulus/controllers/dynamic/filters.controller.ts - About 2 hrs to fix

                            TimezoneService has 23 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            @Injectable({ providedIn: 'root' })
                            export class TimezoneService {
                              constructor(
                                readonly configurationService:ConfigurationService,
                                readonly I18n:I18nService,
                            Severity: Minor
                            Found in frontend/src/app/core/datetime/timezone.service.ts - About 2 hrs to fix

                              Function RestoreQuery has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

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

                                Function edit has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    edit: function () {
                                      var editor = this.getEditor(),
                                          self = this,
                                          maxTabIndex = 0;
                                
                                
                                Severity: Major
                                Found in frontend/src/stimulus/controllers/dynamic/backlogs/model.js - About 2 hrs to fix

                                  File links.rb has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  module OpenProject
                                    module Static
                                      module Links
                                        class << self
                                          def help_link_overridden?
                                  Severity: Minor
                                  Found in lib/open_project/static/links.rb - About 2 hrs to fix

                                    File bcf-wp-attribute-group.component.ts has 268 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

                                      Method fix_other_work_package_positions has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          def fix_other_work_package_positions
                                            if changes.slice("project_id", "type_id", "version_id").present?
                                              if changes.slice("project_id", "version_id").blank? and
                                                 Story.types.include?(type_id.to_i) and
                                                 Story.types.include?(type_id_was.to_i)
                                      Severity: Minor
                                      Found in modules/backlogs/lib/open_project/backlogs/list.rb - About 2 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