Showing 836 of 1,675 total issues
Method display_effort_balancing_input
has a Cognitive Complexity of 24 (exceeds 5 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)
- 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
File wbs_activities_controller.rb
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'will_paginate/array'
class WbsActivitiesController < ApplicationController
#include DataValidationHelper #Module for master data changes validation
include ModuleProjectsHelper
Function start
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
var start = function() {
// drag might have started on an endpoint that is not actually a source, but which has
// one or more connections.
jpc = self.connectorSelector();
var _continue = true;
Consider simplifying this complex logical expression. Open
if (cornerRadius > 0 && current[4] != next[4]) {
var radiusToUse = Math.min(cornerRadius, segLength(current), segLength(next));
// right angle. adjust current segment's end point, and next segment's start point.
current[2] -= current[5] * radiusToUse;
current[3] -= current[6] * radiusToUse;
Consider simplifying this complex logical expression. Open
if (!document.createElement('canvas').getContext) {
(function() {
// alias some functions to make (compiled) code shorter
Function keydown
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
keydown: function(e){
if (this.picker.is(':not(:visible)')){
if (e.keyCode == 27) // allow escape to hide and re-show picker
this.show();
return;
Function dispCrossText
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dispCrossText(ctx, config, posX, posY, borderX, borderY, overlay, data, animPC) {
var i, disptxt, txtposx, txtposy, txtAlign, txtBaseline;
for (i = 0; i < config.crossText.length; i++) {
if (config.crossText[i] != "" && config.crossTextOverlay[Min([i, config.crossTextOverlay.length - 1])] == overlay) {
Method get_chart_data_by_phase_and_profile
has 82 lines of code (exceeds 25 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")
File organization_duplicate_project_worker.rb
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
class OrganizationDuplicateProjectWorker
include Sidekiq::Worker
def perform(est_model_id, new_organization_id, user_id)
est_model = Project.find(est_model_id)
Method display_inputs_without_activities
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def display_inputs_without_activities(module_project)
pbs_project_element = current_component
res = String.new
if module_project.compatible_with(current_component.work_element_type.alias) || 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 plotElement
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
plotElement: function(elem, canvas, opt) {
var gl = canvas.getCtx(),
viewMatrix = new Matrix4,
lighting = canvas.config.Scene.Lighting,
wcanvas = canvas.canvases[0],
Method display_balancing_input
has 80 lines of code (exceeds 25 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
Function drawPieSegments
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawPieSegments(animationDecimal) {
var cumulativeAngle = -config.startAngle * (Math.PI / 180)+2*Math.PI ,
Function appendFill
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function appendFill(ctx, lineStr, min, max) {
var fillStyle = ctx.fillStyle;
var arcScaleX = ctx.arcScaleX_;
var arcScaleY = ctx.arcScaleY_;
var width = max.x - min.x;
Function initSort
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initSort(table, cell, e){
var a, i, j, o, s,
c = table.config,
k = !e[c.sortMultiSortKey],
$this = $(table);
Method import
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def self.import(file, sep)
#find localstatus
@localstatus = RecordStatus.find_by_name('Local')
#create wbs_activity
- 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 append_pemodule
has a Cognitive Complexity of 22 (exceeds 5 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
- 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 drawImage
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
contextPrototype.drawImage = function(image, var_args) {
var dx, dy, dw, dh, sx, sy, sw, sh;
// to find the original width we overide the width and height
var oldRuntimeWidth = image.runtimeStyle.width;
Function drawPieSegments
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawPieSegments(animationDecimal) {
var cumulativeAngle = -config.startAngle * (Math.PI / 180)+2*Math.PI ,
cumvalue = 0,
scaleAnimation = 1,
rotateAnimation = 1;
Method create
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
@is_model = params[:project][:is_model]
if @is_model == "true"
authorize! :manage_estimation_models, Project
else