Showing 836 of 1,675 total issues
Consider simplifying this complex logical expression. Open
if ((config.savePngFunction.split(' ')[1]=="left" && event.which==1) ||
(config.savePngFunction.split(' ')[1]=="middle" && event.which==2) ||
(config.savePngFunction.split(' ')[1]=="right" && event.which==3) ||
(typeof(config.savePngFunction.split(' ')[1])!="string")) saveCanvas(ctx,data,config,tpgraph);
Consider simplifying this complex logical expression. Open
if ((config.annotateFunction.split(' ')[1]=="left" && event.which==1) ||
(config.annotateFunction.split(' ')[1]=="middle" && event.which==2) ||
(config.annotateFunction.split(' ')[1]=="right" && event.which==3) ||
(typeof(config.annotateFunction.split(' ')[1])!="string")) doMouseMove(ctx, config, event)
Function select_or_unselect_all_permissions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function select_or_unselect_all_permissions(clicked_elt, cols_data_name, rows_data_name, rows_or_cols_name){
var group_id = $(clicked_elt).data(cols_data_name);
var permission_id = $(clicked_elt).data(rows_data_name);
var rows_or_cols = $(clicked_elt).data("rows_or_cols_"+rows_or_cols_name);
var at_least_one_selected = false;
- 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_field
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.update_field(view_widget, organization, project, component)
organization.fields.each do |field|
pf = ProjectField.where(field_id: field.id,
- 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_view_widget_positions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update_view_widget_positions
views_widgets = params[:views_widgets]
unless views_widgets.empty?
views_widgets.each_with_index do |element, index|
view_widget_hash = element.last
- 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 set_technology_size_unit_abacus
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def set_technology_size_unit_abacus
authorize! :edit_organizations, Organization
@organization = Organization.find(params[:organization])
@technologies = @organization.organization_technologies
- 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 destroy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def destroy
@views_widget = ViewsWidget.find(params[:id])
current_view = @views_widget.view
pemodule_id = current_view.pemodule_id
@module_project = @views_widget.module_project
- 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 save_values
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def save_values
authorize! :manage_modules_instances, ModuleProject
#set ratio values
ratio_values = params[:ratio_values]
ratio_values.each do |key, value|
- 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 placeAnchorsOnLine
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
placeAnchorsOnLine = function(desc, elementDimensions, elementPosition,
connections, horizontal, otherMultiplier, reverse) {
Function _makeFloatingEndpoint
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
var _makeFloatingEndpoint = function(paintStyle, referenceAnchor, endpoint, referenceCanvas, sourceElement, _jsPlumb, _newEndpoint) {
Function prepareEndpoint
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
prepareEndpoint = function(existing, index, params, element, elementId, connectorPaintStyle, connectorHoverPaintStyle) {
Function placeSomeAnchors
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
placeSomeAnchors = function(desc, elementDimensions, elementPosition, unsortedConnections, isHorizontal, otherMultiplier, orientation) {
Function add_widget
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
fn.add_widget = function(html, size_x, size_y, col, row, max_size, min_size) {
Function WidgetInfo
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function WidgetInfo(helperId, widgetId, displayName, type, flags, startupMode, available) {
Method pemodule_input
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def pemodule_input(level, est_val, module_project, level_estimation_values, pbs_project_element, attribute_type="", read_only_value=false)
Method display_text_field_tag
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def display_text_field_tag(level, est_val, module_project, level_estimation_values, pbs_project_element, attribute_type="", read_only_value=false)
Function populateLabels
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function populateLabels(config, labelTemplateString, labels, numberOfSteps, graphMin, graphMax, stepValue) {
Avoid deeply nested control flow statements. Open
if(typeof adj[j] != 'string') {
data = $.merge(node.data, {});
node = node.nodeTo;
}
Avoid deeply nested control flow statements. Open
if ($.inArray(type, noAnyMatch) < 0) {
matches = typeFunction( c, data );
if (matches !== null) {
filterMatched = matches;
return false;
Avoid deeply nested control flow statements. Open
if (i === c.columns && $column.length) {
wo.filter_$anyMatch = $column;
}