frontend/src/app/features/reporting/reporting-page/functionality/reporting_engine/filters.js
Function Filters
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
Open
Reporting.Filters = function($){
var load_available_values_for_filter = function (filter_name, callback_func) {
var select, radio_options, post_select_values;
select = $('.filter-value[data-filter-name="' + filter_name + '"]').first();
// check if we might have a radio-box
- 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 Filters
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Reporting.Filters = function($){
var load_available_values_for_filter = function (filter_name, callback_func) {
var select, radio_options, post_select_values;
select = $('.filter-value[data-filter-name="' + filter_name + '"]').first();
// check if we might have a radio-box
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 show_filter
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var show_filter = function (field, options) {
var default_options = {
callback_func: function () {},
slowly: false,
show_filter: true,
Function load_available_values_for_filter_from_remote
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var load_available_values_for_filter_from_remote = function(select, filter_name, callback_func) {
var url = select.attr("data-remote-url"),
json_post_select_values = select.attr('data-initially-selected'),
post_select_values;