Showing 836 of 1,675 total issues
Method update
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
set_page_title 'Edit estimation'
@project = Project.find(params[:id])
@organization = @project.organization
Class ApplicationController
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :authenticate_user!
Function Doughnut
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Doughnut = function (data, config, ctx) {
var segmentTotal = 0;
var msr, midPieX, midPieY;
if (!dynamicFunction(data,config,ctx,"Doughnut"))return;
Function Pie
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Pie = function (data, config, ctx) {
var segmentTotal = 0;
var msr, midPieX, midPieY,pieRadius;
if (!dynamicFunction(data,config,ctx,"Pie"))return;
File application_controller.rb
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :authenticate_user!
Function makeSource
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.makeSource = function(el, params, referenceParams) {
var p = jsPlumb.extend({}, referenceParams);
jsPlumb.extend(p, params);
_setEndpointPaintStylesAndAnchor(p, 0);
var jpcl = jsPlumb.CurrentLibrary,
Function init
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function(table, c, wo) {
// filter language options
ts.language = $.extend(true, {}, {
to : 'to',
or : 'or',
Function format
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
format: function(table, c, wo){
if (c.$table.hasClass('hasStickyHeaders')) { return; }
var $t = c.$table,
$win = $(window),
header = $t.children('thead:first'),
Method create
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def create
@is_model = params[:project][:is_model]
if @is_model == "true"
authorize! :manage_estimation_models, Project
else
- 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 execute_duplication_SAVE
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute_duplication_SAVE(project_id, new_organization_id, user_id)
user = User.find(user_id)
#begin
Function PolarArea
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PolarArea = function (data, config, ctx) {
var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, msr, midPosX, midPosY;
if (!dynamicFunction(data,config,ctx,"PolarArea"))return;
Function bindEvents
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bindEvents(table){
var c = table.config,
$this = c.$table,
j, downTime;
// apply event handling to headers
Method update
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def update
authorize! :manage_estimation_widgets, @project
@views_widget = ViewsWidget.find(params[:id])
@view_id = @views_widget.view_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_views_and_widgets
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def update_views_and_widgets(new_prj, old_mp, new_mp)
#For initialization module level
if old_mp.pemodule.alias == Projestimate::Application::INITIALIZATION
#Copy the views and widgets for the new project
new_view = View.create(organization_id: new_prj.organization_id, name: "#{new_prj.to_s} : view for #{new_mp.to_s}", description: "Please rename the view's name and description if needed.")
- 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 restore_change
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def restore_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 drawBars
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawBars(animPc) {
ctx.lineWidth = config.barStrokeWidth;
var yStart = new Array(data.datasets.length);
var cumvalue = new Array();
Method included
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(base)
base.class_eval do
#self relation on master data : Parent<->Child
Function drawBars
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawBars(animPc) {
ctx.lineWidth = config.barStrokeWidth;
var yStart = new Array(data.datasets.length);
var cumvalue = new Array();
Function morph
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
morph: function(json, opt, extraModes) {
extraModes = extraModes || {};
var viz = this.viz;
var options = $.merge(this.options, viz.controller, opt), root = viz.root;
var graph;
Method load_master_data!
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def self.load_master_data!
db=Home::connect_external_database
#begin
record_status = ExternalMasterDatabase::ExternalRecordStatus.all
record_status.each do |i|
- 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"