Showing 836 of 1,675 total issues
Function Arrow
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jsPlumb.Overlays.Arrow = function(params) {
this.type = "Arrow";
AbstractOverlay.apply(this, arguments);
this.isAppendedAtTopLevel = false;
params = params || {};
Function on_resize
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn.on_resize = function(event, ui) {
var rel_x = (ui.pointer.diff_left);
var rel_y = (ui.pointer.diff_top);
var wbd_x = this.options.widget_base_dimensions[0];
var wbd_y = this.options.widget_base_dimensions[1];
Function drawBars
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawBars(animPc) {
var cumvalue = new Array();
var totvalue = new Array();
for (var i = 0; i < data.datasets.length; i++) { for (var j = 0; j < data.datasets[i].data.length; j++) { cumvalue[j] = 0; totvalue[j] = 0; } }
for (var i = 0; i < data.datasets.length; i++) { for (var j = 0; j < data.datasets[i].data.length; j++) totvalue[j] += data.datasets[i].data[j]; }
Function drawBars
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawBars(animPc) {
var t1, t2, t3;
var cumvalue = new Array();
var totvalue = new Array();
File project.rb
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class Project < ActiveRecord::Base
attr_accessible :title, :description, :version, :alias, :state, :estimation_status_id, :status_comment,
:start_date, :is_model, :organization_id, :project_area_id, :project_category_id,
:acquisition_category_id, :platform_category_id, :parent_id
Function makeEventObject
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
makeEventObject: function(e, win) {
var that = this,
graph = this.viz.graph,
fx = this.viz.fx,
ntypes = fx.nodeTypes,
Function format
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
format: function(table, c, wo) {
var i, time, classes, $header, $icon, $tfoot, $h, oldtheme, oldremove,
themesAll = ts.themes,
$table = c.$table,
$headers = c.$headers,
Method restore_change
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def restore_change
authorize! :manage_master_data, :all
#get the record controller name
controller = params[:controller] #controller.controller_name
Consider simplifying this complex logical expression. Open
Open
} else if ( (typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch && this.value !== '') || ( e.type === 'keyup' &&
( (e.which < 32 && e.which !== 8 && wo.filter_liveSearch === true && e.which !== 13) || (e.which >= 37 && e.which <=40) || (e.which !== 13 && wo.filter_liveSearch === false) ) ) ) {
return;
}
Method update_master_data!
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.update_master_data!
db=Home::connect_external_database
puts 'Updating from Master Data...'
#begin
Function loadJSON
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadJSON: function(json) {
if(this.busy) return;
this.busy = true;
var prefix = $.time(),
Function draggable
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function draggable(element, onmove, onstart, onstop) {
onmove = onmove || function () { };
onstart = onstart || function () { };
onstop = onstop || function () { };
var doc = document;
Method update
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def update
@user = User.find(params[:id])
if current_user != @user
authorize! :manage, User
end
- 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 validate_change
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def validate_change
authorize! :manage_master_data, :all
#get the record controller name
controller = params[:controller] #controller.controller_name
- 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 out
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
out: function(){
if(this.busy) return;
this.busy = true;
this.events.hoveredNode = false;
var that = this,
Method generate_report
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def generate_report
conditions = Hash.new
params[:report].each do |i|
unless i.last.blank? or i.last.nil?
Function paint
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.paint = function(params) {
if (visible) {
params = params || {};
Function setRoot
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setRoot: function(id, method, onComplete) {
if(this.busy) return;
this.busy = true;
var that = this, canvas = this.canvas;
var rootNode = this.graph.getNode(this.root);
Function out
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
out: function(){
if(this.busy)
return;
var that = this,
Function DynamicAnchor
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jsPlumb.DynamicAnchor = function(params) {
jsPlumb.Anchor.apply(this, arguments);
this.isSelective = true;
this.isDynamic = true;