opf/openproject

View on GitHub

Showing 635 of 1,693 total issues

Function initializeDatePicker has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private initializeDatePicker() {
    this.datePickerInstance = new DatePicker(
      this.injector,
      this.id,
      this.value || '',

    Function buildDefaultTabs has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private buildDefaultTabs():WpTabDefinition[] {
        return [
          {
            component: WorkPackageOverviewTabComponent,
            name: this.I18n.t('js.work_packages.tabs.overview'),

      Function constructor has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        constructor(readonly I18n:I18nService,
          readonly querySpace:IsolatedQuerySpace,
          readonly wpTableFilters:WorkPackageViewFiltersService) {
          super();
      
      

        Function lazyInit has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private lazyInit(renderer:TimelineCellRenderer, renderInfo:RenderInfo):Promise<void> {
            const body = this.workPackageTimeline.timelineBody[0];
            const cell = this.cellElement;
        
            if (!cell.length) {

          Function extractPayloadFromSchema has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            static extractPayloadFromSchema<T extends HalResource = HalResource>(resource:T, schema:SchemaResource) {
              const payload:any = {
                _links: {},
              };
          
          
          Severity: Minor
          Found in frontend/src/app/features/hal/schemas/hal-payload.helper.ts - About 1 hr to fix

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

              ngOnInit():void {
                if (this.modelCount === 0) {
                  return;
                }
            
            

              Method controller_work_package_new_after_save has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def controller_work_package_new_after_save(context = {})
                    params = context[:params]
                    work_package = context[:work_package]
              
                    return unless work_package.backlogs_enabled?
              Severity: Minor
              Found in modules/backlogs/lib/open_project/backlogs/hooks/layout_hook.rb - About 1 hr to fix

                Function Impediment has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                RB.Impediment = (function ($) {
                  return RB.Object.create(RB.Task, {
                
                    initialize: function (el) {
                      var j;  // This ensures that we use a local 'j' variable, not a global one.
                Severity: Minor
                Found in frontend/src/stimulus/controllers/dynamic/backlogs/impediment.js - About 1 hr to fix

                  Method included has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def self.included(base)
                      base.class_eval do
                        include VersionSettingsHelper
                        helper :version_settings
                  
                  

                    Method update has 33 lines of code (exceeds 25 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 1 hr to fix

                      Function drop has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        async drop(el:Element, target:Element, _source:Element|null, _sibling:Element|null) {
                          const dropUrl = el.getAttribute('data-drop-url');
                      
                          let targetPosition = Array.from(target.children).indexOf(el);
                          if (target.children.length > 0 && target.children[0].getAttribute('data-empty-list-item') === 'true') {

                        Function getFieldTypeConfig has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          private getFieldTypeConfig(field:IOPFieldSchemaWithKey):IOPFormlyFieldSettings|null {
                            const fieldType = field.type.replace('[]', '') as OPFieldType;
                            const inputType = this.inputsCatalogue.find((inputType) => inputType.useForFields.includes(fieldType))!;
                        
                            if (!inputType) {

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

                            ngOnInit() {
                              this.workPackagePath = this.PathHelper.workPackagePath(this.workPackage.id!);
                              this.canModifyHierarchy = !!this.workPackage.changeParent;
                              this.canAddRelation = !!this.workPackage.addRelation;
                          
                          

                            Function loadPrincipalData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              private loadPrincipalData(searchTerm:string) {
                                const nonMemberFilter = new ApiV3FilterBuilder();
                                if (searchTerm) {
                                  nonMemberFilter.add('any_name_attribute', '~', [searchTerm]);
                                }

                              Function calendarMeetingsFunction has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                public calendarMeetingsFunction(
                                  fetchInfo:{ start:Date, end:Date, timeZone:string },
                                  successCallback:(events:EventInput[]) => void,
                                ):void {
                                  if (!this.showMeetings) {

                                Function mockRequest has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  const mockRequest = () => {
                                    httpMock
                                      .match((req) => req.url.includes('/api/v3/capabilities'))
                                      .forEach((req) => {
                                        expect(req.request.method).toBe('GET');

                                  Function newViewer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    public newViewer(elements:XeokitElements, projects:IfcProjectDefinition[]):void {
                                      const server = new XeokitServer(this.pathHelper);
                                      // eslint-disable-next-line @typescript-eslint/no-unsafe-call
                                      const viewerUI = new BIMViewer(server, elements) as XeokitBimViewer;
                                  
                                  

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

                                        initialize: function (el) {
                                          this.$ = $(el);
                                          this.el = el;
                                    
                                          // Associate this object with the element for later retrieval
                                    Severity: Minor
                                    Found in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.js - About 1 hr to fix

                                      Method fix_other_work_package_positions has 32 lines of code (exceeds 25 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 1 hr to fix

                                        Method render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def render
                                            write(content_tag(:div, id: "#{filter_class.underscore_name}_arg_1", class: "advanced-filters--filter-value") do
                                              select_options = {  "data-remote-url": url_for(action: "available_values"),
                                                                  "data-initially-selected": JSON::dump(Array(filter.values).flatten),
                                                                  style: "vertical-align: top;", # FIXME: Do CSS
                                        Severity: Minor
                                        Found in modules/reporting/lib/widget/filters/multi_values.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language