Showing 610 of 1,650 total issues
ConfigurationService
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
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
Function buildV3GetQueryFromJsonParams
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public buildV3GetQueryFromJsonParams(updateJson:string|null) {
const queryData:Partial<QueryRequestParams> = {
pageSize: this.paginationService.getPerPage(),
};
Function initialize
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
- 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
File filters.js
has 272 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 Task
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
RB.Task = (function ($) {
return RB.Object.create(RB.WorkPackage, {
initialize: function (el) {
this.$ = $(el);
Class Version
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Version < ApplicationRecord
include ::Versions::ProjectSharing
include ::Scopes::Scoped
belongs_to :project
Class Base
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Base
include CheckoutInstructions
attr_accessor :url, :root_url
FiltersController
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class FiltersController extends Controller {
static targets = [
'filterFormToggle',
'filterForm',
'filter',
TimezoneService
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Injectable({ providedIn: 'root' })
export class TimezoneService {
constructor(
readonly configurationService:ConfigurationService,
readonly I18n:I18nService,
Function RestoreQuery
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
edit: function () {
var editor = this.getEditor(),
self = this,
maxTabIndex = 0;
Function initializeUiRouterListeners
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function initializeUiRouterListeners(injector:Injector) {
const $transitions:TransitionService = injector.get(TransitionService);
const stateService = injector.get(StateService);
const toastService:ToastService = injector.get(ToastService);
const currentProject:CurrentProjectService = injector.get(CurrentProjectService);
File bcf-wp-attribute-group.component.ts
has 268 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
Method fix_other_work_package_positions
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
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)
- 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
File wp-create.service.ts
has 267 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
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 toggleFormat
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
File links.rb
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module OpenProject
module Static
module Links
class << self
def help_link_overridden?
Function setupServerResponse
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function setupServerResponse() {
initMainMenuExpandStatus();
focusFirstErroneousField();
activateFlashNotice();
activateFlashError();