Showing 836 of 1,675 total issues
Method show_element_name
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
def show_element_name(element)
if element.attributes.has_key? 'record_status_id'
if element.is_root?
"<span class='#{h element.record_status.to_s }'>#{h element.name} </span>"
else
- 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 drawPicker
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawPicker(x, y) {
if(!jscolor.picker) {
jscolor.picker = {
box : document.createElement('div'),
boxB : document.createElement('div'),
File views_widgets_helper.rb
has 478 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ViewsWidgetsHelper
# Get the label widget data
def get_label_widget_data(view_widget_id)
view_widget = ViewsWidget.find(view_widget_id)
Method initialize
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def initialize(user, organization)
#Uncomment in order to authorize everybody to manage all the app
if Rails.env == "test" || user.super_admin == true
can :manage, :all
- 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 Tree
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
Layouts.Tree = (function() {
//Layout functions
var slice = Array.prototype.slice;
/*
Function AbstractConnector
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
jsPlumb.Connectors.AbstractConnector = function(params) {
AbstractComponent.apply(this, arguments);
var self = this,
Method get_chart_data_by_phase_and_profile
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def get_chart_data_by_phase_and_profile(pbs_project_element, module_project, estimation_value, view_widget)
result = String.new
stacked_data = Array.new
profiles_wbs_data = Hash.new
probable_est_value = estimation_value.send("string_data_probable")
- 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 checkout
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def checkout
old_prj = Project.find(params[:project_id])
authorize! :commit_project, old_prj
- 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_estimation_results
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def save_estimation_results(start_module_project, input_attributes, output_data)
#@project = current_project
authorize! :execute_estimation_plan, @project
@pbs_project_element = current_component
- 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 _compute
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
this._compute = function(paintInfo, params) {
if (params.clearEdits)
userSuppliedSegments = null;
Method execute_duplication
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute_duplication(project_id, new_organization_id)
#begin
old_prj = Project.find(project_id)
new_organization = Organization.find(new_organization_id)
Method execute_duplication
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute_duplication(project_id, new_organization_id, user_id)
user = User.find(user_id)
#begin
Function _initDropTarget
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _initDropTarget = function(canvas, forceInit, isTransient, endpoint) {
if ((params.isTarget || forceInit) && jpcl.isDropSupported(_element)) {
var dropOptions = params.dropOptions || _jsPlumb.Defaults.DropOptions || jsPlumb.Defaults.DropOptions;
dropOptions = jsPlumb.extend( {}, dropOptions);
dropOptions.scope = dropOptions.scope || self.scope;
Function initializeViz
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
initializeViz: function() {
var config = this.config, that = this;
var nodeType = config.type.split(":")[0],
horz = config.orientation == 'horizontal',
nodeLabels = {};
Function overlayCapableJsPlumbUIComponent
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
overlayCapableJsPlumbUIComponent = window.overlayCapableJsPlumbUIComponent = function(params) {
jsPlumbUIComponent.apply(this, arguments);
var self = this;
this.overlays = [];
Function initializeViz
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
initializeViz: function() {
var config = this.config,
that = this,
nodeType = config.type.split(":")[0],
nodeLabels = {};
Function initialize
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initialize() {
if (IE) {
container.find("*:not(input)").attr("unselectable", "on");
}
Consider simplifying this complex logical expression. Open
if (existing) {
self.endpoints[index] = existing;
existing.addConnection(self);
} else {
if (!params.endpoints) params.endpoints = [ null, null ];
Method display_balancing_input
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def display_balancing_input(module_project, last_estimation_result)
pbs_project_element = current_component
#Get the current balancing attribute
@current_balancing_attribute = current_balancing_attribute
- 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 format
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
format: function(table, c, wo) {
// filter widget doesn't initialize on an empty table. Fixes #449
if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
return;
}