Showing 620 of 1,668 total issues
Method modify_conditions
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function setupServerResponse
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function setupServerResponse() {
initMainMenuExpandStatus();
focusFirstErroneousField();
activateFlashNotice();
activateFlashError();
File notifications-settings-page.component.ts
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
Input,
Class ProjectQuery
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Authorization::ProjectQuery < Authorization::AbstractQuery
self.model = Project
def self.projects_members_join(user)
projects_table[:id]
Class Timestamp
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Timestamp
ALLOWED_DATE_KEYWORDS = ["oneDayAgo", "lastWorkingDay", "oneWeekAgo", "oneMonthAgo"].freeze
delegate :hash, to: :to_s
SortByConfigController
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class SortByConfigController extends Controller {
static targets = [
'sortByField',
'inputRow',
'inputRowContainer',
CustomTextEditFieldService
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Injectable()
export class CustomTextEditFieldService extends EditFieldHandler {
public fieldName = 'text';
public valueChanged$:BehaviorSubject<string>;
Consider simplifying this complex logical expression. Open
Open
if (event.buttons === 1 || event.which === 1 || event.which === 0) {
// Getting starting position
this.oldX = this.startX = event.clientX || event.pageX || event.touches[0].clientX;
this.oldY = this.startY = event.clientY || event.pageY || event.touches[0].clientY;
WorkPackageViewTimelineService
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Injectable()
export class WorkPackageViewTimelineService extends WorkPackageQueryStateService<WorkPackageTimelineState> {
/** Remember the computed zoom level to correct zooming after leaving autozoom */
public appliedZoomLevel$ = input<TimelineZoomLevel>('auto');
Function buildItemsForVersion
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildItemsForVersion(version:VersionResource):OpContextMenuItem[] {
const id = version.id!;
return [
{
// Lock version
File filters.controller.ts
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* -- copyright
* OpenProject is an open source project management software.
* Copyright (C) 2023 the OpenProject GmbH
*
File custom-fields.controller.ts
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* -- copyright
* OpenProject is an open source project management software.
* Copyright (C) 2023 the OpenProject GmbH
*
Function initializeDrake
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected initializeDrake(containers:Element[]) {
this.drake = dragula(containers, {
moves: (el:any, container:any, handle:any, sibling:any) => {
const member = this.getMember(container);
return member ? member.moves(el, container, handle, sibling) : false;
Function constructor
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
constructor(public readonly injector:Injector,
public table:WorkPackageTable) {
// The DragService may not have been provided
// in which case we do not provide drag and drop
if (this.dragService === null) {
- Read upRead up
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 buildItems
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected buildItems():OpContextMenuItem[] {
const items = this.permittedActions.map((action:WorkPackageAction) => ({
class: undefined as string|undefined,
disabled: false,
linkText: action.text,
File op-settings-dropdown-menu.directive.ts
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
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 reorder-delta-builder.ts
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { debugLog } from 'core-app/shared/helpers/debug_output';
import { QueryOrder } from 'core-app/core/apiv3/endpoints/queries/apiv3-query-order';
// min allowed position
export const MIN_ORDER = -2147483647;
File project-include.component.ts
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
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 ngOnInit
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ngOnInit():void {
this.configuration = new WorkPackageTableConfiguration(this.configurationObject);
this.$element = jQuery(this.elementRef.nativeElement);
// Clear any old table subscribers
File url-params-helper.spec.ts
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
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