Showing 610 of 1,650 total issues
Function buildQueries
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public buildQueries():IStaticQuery[] {
let items:IStaticQuery[] = [
{
title: this.text.all_open,
uiSref: 'work-packages',
Function makeSplitViewRoutes
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function makeSplitViewRoutes(baseRoute:string,
menuItemClass:string|undefined,
showComponent:ComponentType<unknown>,
newComponent:ComponentType<unknown> = WorkPackageNewSplitViewComponent,
makeFullWidth?:boolean,
StorageComponent
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'op-storage',
templateUrl: './storage.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [{ provide: OpUploadService, useClass: StorageUploadService }],
Function initializeGlobalListeners
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function initializeGlobalListeners():void {
document
.documentElement
.addEventListener('click', (evt:MouseEvent) => {
const target = evt.target as HTMLElement;
Method search
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def search(tokens, projects = nil, options = {})
tokens = Array(tokens)
projects = [] << projects unless projects.nil? || projects.is_a?(Array)
find_order = "#{searchable_options[:order_column]} " + (options[:before] ? "DESC" : "ASC")
- 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 ngOnInit
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit():void {
this.form.disable();
this.userId = (this.userId || this.uiRouterGlobals.params.userId) as string;
this.eeShowBanners = this.bannersService.eeShowBanners;
Class HistoricActiveRecordRelation
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Journable::HistoricActiveRecordRelation < ActiveRecord::Relation
attr_accessor :timestamp
include ActiveRecord::Delegation::ClassSpecificRelation
TopMenuService
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable({ providedIn: 'root' })
export class TopMenuService {
private hover = false;
private menuIsOpen = false;
Function listenToSettingChanges
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function listenToSettingChanges() {
jQuery('#settings_session_ttl_enabled').on('change', function () {
jQuery('#settings_session_ttl_container').toggle(jQuery(this).is(':checked'));
}).trigger('change');
Method full_breadcrumbs
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def full_breadcrumbs
render(Primer::Beta::Breadcrumbs.new(test_selector: "op-breadcrumb")) do |breadcrumbs|
breadcrumb_paths.each_with_index do |item, index|
item = anchor_string_to_object(item) if item.is_a?(String) && item.start_with?("\u003c")
- 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 selectNextResult
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private selectNextResult(activeID:ID|null, allProjects:IProjectData[]):void {
if (activeID === null) {
return;
}
- 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 Story
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
RB.Story = (function ($) {
return RB.Object.create(RB.WorkPackage, RB.EditableInplace, {
initialize: function (el) {
this.$ = $(el);
this.el = el;
Class CustomStylesController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class CustomStylesController < ApplicationController
layout "admin"
menu_item :custom_style
before_action :require_admin,
Class BaseContract
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class BaseContract < ::ModelContract
include OpenProject::StaticRouting::UrlHelpers
include AssignableValuesContract
include ::Attachments::ValidateReplacements
OpProjectIncludeComponent
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'op-project-include',
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './project-include.component.html',
styleUrls: ['./project-include.component.sass'],
WpGraphConfigurationService
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class WpGraphConfigurationService {
private _configuration:WpGraphConfiguration;
private _globalScope = false;
SelectEditFieldComponent
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
templateUrl: './select-edit-field.component.html',
})
export class SelectEditFieldComponent extends EditFieldComponent implements OnInit {
@InjectField() selectAutocompleterRegister:SelectAutocompleterRegisterService;
IanCenterService
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
@EffectHandler
export class IanCenterService extends UntilDestroyedMixin {
readonly id = 'ian-center';
HalResource
has 24 functions (exceeds 20 allowed). Consider refactoring. 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
WorkPackagesListService
has 24 functions (exceeds 20 allowed). Consider refactoring. 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