opf/openproject

View on GitHub

Showing 635 of 1,693 total issues

File notifications-settings-page.component.ts has 253 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, OnInit } from '@angular/core';
import { UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { take } from 'rxjs/internal/operators/take';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { CurrentUserService } from 'core-app/core/current-user/current-user.service';

    Function exports has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (config) {
      config.set({
        basePath: '',
        files: [
          // I18n.js is provided by the Asset pipeline,
    Severity: Major
    Found in frontend/karma.conf.js - About 2 hrs to fix

      Method change has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def change
          # see https://docs.github.com/en/rest/reference/pulls
          create_table :github_pull_requests do |t|
            t.references :github_user
            t.references :merged_by

        Function saveChanges has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public saveChanges():void {
            const prefs = this.storeService.store.getValue();
            const notificationSettings = (this.form.value as IFullNotificationSettingsValue);
            const globalNotification = prefs.notifications.find((notification) => !notification._links.project.href) as INotificationSetting;
            const globalPrefs:INotificationSetting = {

          Function open has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            open() {
              this._opened = true;
              this.updateAppHeight();
              this.cdRef.detectChanges();
          
          
          Severity: Major
          Found in frontend/src/app/spot/components/drop-modal/drop-modal.component.ts - About 2 hrs to fix

            File filters-form.controller.ts has 251 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * -- copyright
             * OpenProject is an open source project management software.
             * Copyright (C) 2023 the OpenProject GmbH
             *

              Function Reporting has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              window.Reporting = (function($) {
                var onload = function (func) {
                  $(document).ready(func);
                };
              
              

                Function userDependentQueries has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  private userDependentQueries():IStaticQuery[] {
                    return [
                      {
                        title: this.text.created_by_me,
                        uiSref: 'work-packages',

                  Function calculateViewParams has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    private calculateViewParams(currentParams:TimelineViewParameters):boolean {
                      if (this.disableViewParamsCalculation) {
                        return false;
                      }
                  
                  

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

                      def up
                        Migration::MigrationSquasher.squash(migrations) do
                          create_table "meeting_contents", id: :integer do |t|
                            t.string "type"
                            t.integer "meeting_id"

                      Function initializeCoreEditFields has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function initializeCoreEditFields(editFieldService:EditFieldService, selectAutocompleterRegisterService:SelectAutocompleterRegisterService) {
                        return ():void => {
                          editFieldService.defaultFieldType = 'text';
                          editFieldService
                            .addFieldType(TextEditFieldComponent, 'text', ['String'])

                        Function boardTourSteps has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function boardTourSteps(edition:'basic'|'enterprise', project:ProjectName):OnboardingStep[] {
                          let boardName:string;
                          if (edition === 'basic') {
                            boardName = project === ProjectName.demo ? 'Basic board' : 'Task board';
                          } else {
                        Severity: Minor
                        Found in frontend/src/app/core/setup/globals/onboarding/tours/boards_tour.ts - About 1 hr to fix

                          Function ngOnInit has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            ngOnInit():void {
                              // Unset the isNew flag
                              this.initiallyFocused = this.resource.isNewWidget;
                              this.resource.isNewWidget = false;
                          
                          

                            Function uploadAndCreateFileLink has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              private uploadAndCreateFileLink(data:UploadData):void {
                                let isUploadError = false;
                            
                                this.storage
                                  .pipe(

                              Function updateTimeframe has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                async updateTimeframe(
                                  fetchInfo:{ start:Date, end:Date, timeZone:string },
                                  projectIdentifier:string|undefined,
                                ):Promise<unknown> {
                                  await this.requireNonWorkingDays(fetchInfo.start);

                                Function teamPlannerTourSteps has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function teamPlannerTourSteps():OnboardingStep[] {
                                  return [
                                    {
                                      'next .team-planner-view-menu-item': I18n.t('js.onboarding.steps.team_planner.overview'),
                                      showSkip: false,

                                  Method copy has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def copy
                                      @source_type = if params[:source_type_id].blank? || params[:source_type_id] == "any"
                                                       nil
                                                     else
                                                       ::Type.find(params[:source_type_id])
                                  Severity: Minor
                                  Found in app/controllers/workflows_controller.rb - About 1 hr 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 onDaysMoved has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    public onDaysMoved(change:WorkPackageChangeset,
                                      dayUnderCursor:Moment,
                                      delta:number,
                                      direction:MouseDirection):CellDateMovement {
                                      const initialStartDate = change.pristineResource.startDate;

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

                                    function setupTestBed() {
                                      // noinspection JSIgnoredPromiseFromCall
                                      void TestBed.configureTestingModule({
                                        imports: [
                                          UIRouterModule.forRoot({}),

                                    Function renderRelation has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      private renderRelation(vp:TimelineViewParameters,
                                        e:TimelineRelationElement,
                                        idxFrom:number,
                                        idxTo:number,
                                        startCell:WorkPackageTimelineCell,
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language