Showing 836 of 1,675 total issues
Method dashboard
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def dashboard
authorize! :show_project, @project
# return if user doesn't have the rigth to consult the estimation
if !can_show_estimation?(@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 _doOne
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
_doOne = function(_el) {
// get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,
// and use the endpoint definition if found.
var elid = _getId(_el),
parentElement = function() {
Function DragManager
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
var DragManager = function(_currentInstance) {
var _draggables = {}, _dlist = [], _delements = {}, _elementsWithEndpoints = {},
// elementids mapped to the draggable to which they belong.
_draggablesForElements = {};
Method update_records
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.update_records(external, local, fields)
loc_defined_rs_id = RecordStatus.find_by_name('Defined').id
loc_custom_rs_id = RecordStatus.find_by_name('Custom').id
loc_local_rs_id = RecordStatus.find_by_name('Local').id
ext_defined_rs_id = ExternalMasterDatabase::ExternalRecordStatus.find_by_name('Defined').id
Function table_sorter_filter
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
$(function table_sorter_filter() {
var pagerOptions = {
// target the pager markup - see the HTML block below
Function findRows
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
findRows = function(filter, v, cv){
var $tb, $tr, $td, cr, r, l, ff, time, r1, r2, searchFiltered;
if (c.debug) { time = new Date(); }
for (k = 0; k < b.length; k++ ){
if (b.eq(k).hasClass(c.cssInfoBlock)) { continue; } // ignore info blocks, issue #264
Method display_inputs_with_activities
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
def display_inputs_with_activities(module_project, last_estimation_result=nil)
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)
Function drop
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
drop = function() {
self["removeClass"](_jsPlumb.endpointDropAllowedClass);
self["removeClass"](_jsPlumb.endpointDropForbiddenClass);
Method duplicate
has 109 lines of code (exceeds 25 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
Method execute_duplication_SAVE_NOT_WORKING
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.execute_duplication_SAVE_NOT_WORKING(project_id, parameters, create_from_template = nil)
#Project.transaction do
begin
old_prj = Project.find(project_id)
Method destroy
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def destroy
@project = Project.find(params[:id])
authorize! :delete_project, @project
is_model = @project.is_model
- 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 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
format: function(table, c, wo) {
if (c.$table.hasClass('hasResizable')) { return; }
c.$table.addClass('hasResizable');
ts.resizableReset(table, true); // set default widths
var $rows, $columns, $column, column, timer,
Method dashboard
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dashboard
authorize! :show_project, @project
# return if user doesn't have the rigth to consult the estimation
if !can_show_estimation?(@project)
Method save_effort_breakdown
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save_effort_breakdown
authorize! :execute_estimation_plan, @project
@pbs_project_element = current_component
@tmp_results = Hash.new
Method is_validate
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def is_validate(val)
pe_attribute = self.pe_attribute
#if value is mandatory and not fill => false
if self.is_mandatory and val.blank?
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
Function doMouseMove
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doMouseMove(ctx, config, event) {
font = "<font face=" + config.annotateFontFamily + " size=" + config.annotateFontSize + "px style=\"font-style:" + config.annotateFontStyle + ";color:" + config.annotateFontColor + "\">";
var annotateDIV = document.getElementById('divCursor');
Function drawLines
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawLines(animPc) {
var totvalue = new Array();
var maxvalue = new Array();
Function makeTarget
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.makeTarget = function(el, params, referenceParams) {
var p = jsPlumb.extend({_jsPlumb:_currentInstance}, referenceParams);
jsPlumb.extend(p, params);
_setEndpointPaintStylesAndAnchor(p, 1);
Function initializeViz
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
initializeViz: function() {
var config = this.config, that = this;
var nodeType = config.type.split(":")[0];
var delegate = new $jit.Sunburst({
injectInto: config.injectInto,
Method display_results_with_activities
has 97 lines of code (exceeds 25 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