Showing 836 of 1,675 total issues
Method display_results_with_activities
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
def display_results_with_activities(module_project)
res = String.new
pbs_project_element = @pbs_project_element || current_component
pe_wbs_activity = module_project.project.pe_wbs_projects.activities_wbs.first
- 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 Flowchart
has 282 lines of code (exceeds 25 allowed). Consider refactoring. Open
jsPlumb.Connectors.Flowchart = function(params) {
this.type = "Flowchart";
params = params || {};
params.stub = params.stub || 30;
var self = this,
Method display_input
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
def display_input
res = String.new
unless @project.nil?
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 HorizontalStackedBar
has 281 lines of code (exceeds 25 allowed). Consider refactoring. Open
var HorizontalStackedBar = function (data, config, ctx) {
var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, barWidth, rotateLabels = 0, msr;
if (!dynamicFunction(data,config,ctx,"HorizontalStackedBar"))return;
Function StackedBar
has 274 lines of code (exceeds 25 allowed). Consider refactoring. Open
var StackedBar = function (data, config, ctx) {
var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, barWidth, rotateLabels = 0, msr;
if (!dynamicFunction(data,config,ctx,"StackedBar"))return;
Function Line
has 260 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Line = function (data, config, ctx) {
var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, rotateLabels = 0, msr;
var annotateCnt = 0;
Function URI
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
URI : function(uri) { // See RFC3986
this.scheme = null;
this.authority = null;
this.path = '';
- 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 duplicate
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def duplicate
# To duplicate a project user need to have the "show_project" and "create_project_from_scratch" authorizations
if params[:action_name] == "duplication"
authorize! :create_project_from_scratch, Project
# To Create a project from a template user need to have "create_project_from_template" authorization
- 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 jsPlumbUIComponent
has 256 lines of code (exceeds 25 allowed). Consider refactoring. Open
jsPlumbUIComponent = window.jsPlumbUIComponent = function(params) {
var self = this,
a = arguments,
_hover = false,
parameters = params.parameters || {},
Function Radar
has 244 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Radar = function (data, config, ctx) {
var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, msr, midPosX, midPosY;
if (!dynamicFunction(data,config,ctx,"Radar"))return;
Method display_effort_or_cost_per_phase
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
def display_effort_or_cost_per_phase(pbs_project_element, module_project_id, estimation_value, view_widget_id)
res = String.new
view_widget = ViewsWidget.find(view_widget_id)
module_project = ModuleProject.find(module_project_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
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
def update
@module_project = ModuleProject.find(params[:id])
@project = @module_project.project
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 Bar
has 228 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Bar = function (data, config, ctx) {
var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, barWidth, rotateLabels = 0, msr;
var annotateCnt = 0;
if (!dynamicFunction(data,config,ctx,"Bar"))return;
File home.rb
has 543 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'open-uri'
require 'mysql2'
class Home < ActiveRecord::Base
attr_accessible
Function HorizontalBar
has 221 lines of code (exceeds 25 allowed). Consider refactoring. Open
var HorizontalBar = function (data, config, ctx) {
var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, barWidth, rotateLabels = 0, msr;
if (!dynamicFunction(data,config,ctx,"HorizontalBar"))return;
Method save_effort_breakdown
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def save_effort_breakdown
authorize! :execute_estimation_plan, @project
@pbs_project_element = current_component
@tmp_results = Hash.new
- 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 get_view_widget_data
has 214 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_view_widget_data(module_project_id, view_widget_id)
# General data
view_widget = ViewsWidget.find(view_widget_id)
pbs_project_elt = current_component
Class ProjectsController
has 59 methods (exceeds 20 allowed). Consider refactoring. Open
class ProjectsController < ApplicationController
include WbsActivityElementsHelper
include ModuleProjectsHelper
include ProjectsHelper
include PemoduleEstimationMethods
Method create_organization_from_image
has 206 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_organization_from_image
authorize! :manage, Organization
case params[:action_name]
#Duplicate organization
Function findRows
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
findRows: function(table, filters, combinedFilters) {
if (table.config.lastCombinedFilter === combinedFilters || !table.config.widgetOptions.filter_initialized) { return; }
var len, $rows, rowIndex, tbodyIndex, $tbody, $cells, $cell, columnIndex,
childRow, lastSearch, hasSelect, matches, result, showRow, time, val, indx,
notFiltered, searchFiltered, filterMatched, excludeMatch, fxn, ffxn,