Showing 620 of 1,668 total issues
HalResource
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
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
IanCenterService
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Injectable()
@EffectHandler
export class IanCenterService extends UntilDestroyedMixin {
readonly id = 'ian-center';
WorkPackagesListService
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
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
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 toggleFormat
has 65 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);
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 wp-create.service.ts
has 273 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 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;
File links.rb
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module OpenProject
module Static
module Links
class << self
def help_link_overridden?
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"