Showing 836 of 1,675 total issues
Method display_effort_or_cost_per_phase
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function Arc
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Arc : function(params) {
var self = this,
_super = jsPlumb.Segments.AbstractSegment.apply(this, arguments),
_calcAngle = function(_x, _y) {
return jsPlumbUtil.theta([params.cx, params.cy], [_x, _y]);
Function redraw
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.redraw = function(elementId, ui, timestamp, offsetToUI, clearEdits) {
if (!jsPlumbInstance.isSuspendDrawing()) {
// get all the endpoints for this element
var ep = _amEndpoints[elementId] || [],
Function AbstractDOMOverlay
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var AbstractDOMOverlay = function(params) {
jsPlumb.DOMElementComponent.apply(this, arguments);
AbstractOverlay.apply(this, arguments);
var self = this, initialised = false, jpcl = jsPlumb.CurrentLibrary;
Function fill
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fill: function() {
var d = new Date(this.viewDate),
year = d.getUTCFullYear(),
month = d.getUTCMonth(),
startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
Function render
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
'render' : function(node, canvas) {
var pos = node.pos.getc(true),
width = node.getData('width'),
height = node.getData('height'),
algnPos = this.getAlignedPos(pos, width, height),
Function click
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
click: function(e) {
e.preventDefault();
var target = $(e.target).closest('span, td, th');
if (target.length == 1) {
switch(target[0].nodeName.toLowerCase()) {
Function SpkMultiWidget
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SpkMultiWidget(helperId) {
this.helperId = helperId;
allMultiWidgets[""+helperId] = this;
this.eventHandlers = new Array();
this.refreshIntervalSecs = REFRESH_SECS;
Function render
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
'render' : function(node, canvas) {
var pos = node.pos.getc(true),
width = node.getData('width'),
height = node.getData('height'),
algnPos = this.getAlignedPos(pos, width, height),
Function URI
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
URI : function(uri) { // See RFC3986
this.scheme = null;
this.authority = null;
this.path = '';
Method update
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def update
@module_project = ModuleProject.find(params[:id])
@project = @module_project.project
authorize! :alter_estimation_plan, @project
Method checkout
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def checkout
old_prj = Project.find(params[:project_id])
authorize! :commit_project, old_prj
Function SpkMultiWidget
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
function SpkMultiWidget(helperId) {
this.helperId = helperId;
allMultiWidgets[""+helperId] = this;
this.eventHandlers = new Array();
this.refreshIntervalSecs = REFRESH_SECS;
- 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 generate_report
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
def generate_report
conditions = Hash.new
params[:report].each do |i|
unless i.last.blank? or i.last.nil?
- 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 initialize
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function render
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
'render' : function(node, canvas) {
var pos = node.pos.getp(true),
dimArray = node.getData('dimArray'),
valueArray = node.getData('valueArray'),
colorArray = node.getData('colorArray'),
Class OrganizationsController
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class OrganizationsController < ApplicationController
load_resource
require 'rubygems'
require 'securerandom'
include ProjectsHelper
Function render
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
'render' : function(node, canvas) {
var pos = node.pos.getc(true),
width = node.getData('width'),
height = node.getData('height'),
algnPos = this.getAlignedPos(pos, width, height),
Function parseDate
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parseDate: function(date, format, language) {
if (date instanceof Date) return date;
if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) {
var part_re = /([\-+]\d+)([dmwy])/,
parts = date.match(/([\-+]\d+)([dmwy])/g),
Function format
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
format: function(table, c, wo){
if (c.$table.hasClass('hasResizable')) { return; }
c.$table.addClass('hasResizable');
var $t, t, i, j, s = {}, $c, $cols, w, tw,
$tbl = c.$table,