Showing 836 of 1,675 total issues
Consider simplifying this complex logical expression. Open
if (searchFiltered) {
// cycle through all filters; include last (columnIndex + 1 = match any column). Fixes #669
for (indx = 0; indx < columnIndex + 1; indx++) {
val = filters[indx] || '';
// break out of loop if we've already determined not to search filtered rows
Function Straight
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Straight : function(params) {
var self = this,
_super = jsPlumb.Segments.AbstractSegment.apply(this, arguments),
length, m, m2, x1, x2, y1, y2,
_recalc = function() {
Function mutate_widget_in_gridmap
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
fn.mutate_widget_in_gridmap = function($widget, wgd, new_wgd) {
var old_size_x = wgd.size_x;
var old_size_y = wgd.size_y;
var old_cells_occupied = this.get_cells_occupied(wgd);
Method update
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
@user = User.find(params[:id])
if current_user != @user
authorize! :manage, User
end
Function StateMachine
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
jsPlumb.Connectors.StateMachine = function(params) {
params = params || {};
this.type = "StateMachine";
var self = this,
Method build_ancestry
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def self.build_ancestry(elements, activity_id)
elements.each do |elt|
ActiveRecord::Base.transaction do
hierarchy = elt.dotted_id
ancestors = []
- 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 create
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def create
authorize! :manage_estimation_widgets, @project
# Add the position_x and position_y to params
@view_id = params[:views_widget][:view_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 compute_probable_value
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def compute_probable_value(minimum, most_likely, maximum, estimation_value=nil)
# Get the number of not null value
input_data = {:min => minimum, :ml => most_likely, :max => maximum}
not_integer_or_float = Array.new
sum_of_not_null = 0.0
- 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 drawScale
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawScale() {
var rotationDegree = (2 * Math.PI) / data.datasets[0].data.length;
ctx.save();
ctx.translate(midPosX, midPosY);
Function drawText_
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) {
var m = this.m_,
delta = 1000,
left = 0,
right = delta,
Function _drop
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drop = function() {
var originalEvent = jsPlumb.CurrentLibrary.getDropEvent(arguments),
targetCount = _currentInstance.select({target:elid}).length;
Method create
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
authorize! :create_organizations, Organization
@organization = Organization.new(params[:organization])
Function Image
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
jsPlumb.Endpoints.Image = function(params) {
this.type = "Image";
DOMElementEndpoint.apply(this, arguments);
Method save_estimation_results
has 70 lines of code (exceeds 25 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
Function stroke
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
contextPrototype.stroke = function(aFill) {
var lineStr = [];
var lineOpen = false;
var W = 10;
Method display_effort_balancing_input
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def display_effort_balancing_input(module_project, last_estimation_result)
pbs_project_element = current_component
res = String.new
if module_project.compatible_with(current_component.work_element_type.alias) || current_component
pemodule = Pemodule.find(module_project.pemodule.id)
Method append_pemodule
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def append_pemodule
@project = Project.find(params[:project_id])
@pemodule = Pemodule.find(params[:module_selected].split(',').last.to_i)
authorize! :alter_estimation_plan, @project
Method is_validate
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def is_validate(val)
#deserialize options to do something like that : ['integer', '>=', 50]
array = pe_attribute.options.compact.reject { |s| s.nil? or s.empty? or s.blank? }
#test attribute type and check validity (numeric = float and integer)
- 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 display_effort_balancing_output
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def display_effort_balancing_output(module_project)
pbs_project_element = @pbs_project_element || current_component
res = String.new
if module_project.compatible_with(current_component.work_element_type.alias) || current_component
pemodule = Pemodule.find(module_project.pemodule.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 edit
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def edit
set_page_title 'Edit estimation'
@project = Project.find(params[:id])
@organization = @project.organization
- 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"