Showing 635 of 1,693 total issues
Function detectOnboardingTour
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function detectOnboardingTour():void {
// ------------------------------- Global -------------------------------
const url = new URL(window.location.href);
const isMobile = document.body.classList.contains('-browser-mobile');
const demoProjectsAvailable = jQuery('meta[name=demo_projects_available]').attr('content') === 'true';
Function registerWorkPackageMouseHandler
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
export function registerWorkPackageMouseHandler(this:void,
injector:Injector,
getRenderInfo:() => RenderInfo,
workPackageTimeline:WorkPackageTimelineTableController,
halEditing:HalResourceEditingService,
Method initialize
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
self.issue_attributes = {}
opts = GetoptLong.new(
["--help", "-h", GetoptLong::NO_ARGUMENT],
Method to_html
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_html
words = self.words.map { |word| h(word) }
words_add = 0
words_del = 0
dels = 0
Function insertInList
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const insertInList = (
projects:IProject[],
project:IProject,
list:IProjectData[],
ancestors:IHalResourceLink[],
Function initializeCoreDisplayFields
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function initializeCoreDisplayFields(displayFieldService:DisplayFieldService) {
return () => {
displayFieldService.defaultFieldType = 'text';
displayFieldService
.addFieldType(TextDisplayField, 'text', ['String'])
Function ngOnInit
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit():void {
this.storage = this.storagesResourceService.requireEntity(this.projectStorage._links.storage.href);
this.fileLinks = this.collectionKey()
.pipe(
Function showForm
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected showForm() {
this
.createdWorkPackage()
.then((changeset:WorkPackageChangeset) => {
this.change = changeset;
Function handleMouseMoveOnEmptyCell
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleMouseMoveOnEmptyCell(ev:MouseEvent) {
const wp = renderInfo.workPackage;
if (!renderer.isEmpty(wp)) {
return;
Function ngOnInit
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public ngOnInit() {
super.ngOnInit();
this.htmlId = `user_activity_edit_field_${this.activityNo}`;
this.updateCommentText();
Function setQueryProps
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private setQueryProps():void {
const filters:any[] = [];
let columns = ['id', 'project', 'subject', 'type', 'status', 'updatedAt'];
if (this.globalSearchService.searchTermIsId) {
Method replace
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def replace(avatar)
if avatar.nil?
return ServiceResult.failure.tap do |_result|
return error_result(I18n.t(:empty_file_error))
end
- 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
Method update_remaining_hours
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def update_remaining_hours
if WorkPackage.use_status_for_done_ratio?
update_remaining_hours_from_percent_complete
elsif WorkPackage.use_field_for_done_ratio? &&
work_package.estimated_hours_changed?
- 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
Method inspect_response
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def inspect_response(auth_hash)
response = auth_hash.dig(:extra, :response_object)
if response
code = response.status_code ? "(CODE #{response.status_code})" : nil
message = response.status_message ? "(MESSAGE #{response.status_code})" : nil
- 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
Method try_context_object
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def try_context_object
if params[:context]
context = parse_context
namespace = context[:namespace]
- 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 replaceDatesWithNewSelection
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private replaceDatesWithNewSelection(activeField:DateFields, selectedDate:Date) {
/**
Overwrite flatpickr default behavior by not starting a new date range everytime but preserving either start or end date.
There are three cases to cover.
1. Everything before the current start date will become the new start date (independent of the active field)
- 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 replaceDatesWithNewSelection
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private replaceDatesWithNewSelection(activeField:DateFields, selectedDate:Date) {
/**
Overwrite flatpickr default behavior by not starting a new date range everytime but preserving either start or end date.
There are three cases to cover.
1. Everything before the current start date will become the new start date (independent of the active field)
- 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
Method update
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
wiki_menu_setting = wiki_menu_item_params[:setting]
parent_wiki_menu_item = params[:parent_wiki_menu_item]
get_data_from_params(params)
Method register!
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def register!
# Listen to enqueues
ActiveSupport::Notifications.subscribe(/enqueue(_at)?\.active_job/) do |_name, _started, _call, _id, payload|
job = payload[:job]
next unless job
Method rebuild_silently!
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rebuild_silently!(roots = nil)
# Don't rebuild a valid tree.
return true if valid?
scope = lambda { |_node| }