Showing 836 of 1,675 total issues
Function inputToRGB
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function inputToRGB(color) {
var rgb = { r: 0, g: 0, b: 0 };
var a = 1;
var ok = false;
Function drawScale
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawScale() {
//X axis line
ctx.lineWidth = config.scaleLineWidth;
Function saveCanvas
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function saveCanvas(ctx,data,config,tpgraph) {
cvSave = ctx.getImageData(0,0,ctx.canvas.width, ctx.canvas.height);
var saveCanvasConfig = {
savePng : false,
Function drawScale
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawScale() {
//X axis line
ctx.lineWidth = config.scaleLineWidth;
Method import_user
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import_user
sep = "#{params[:separator].blank? ? I18n.t(:general_csv_separator) : params[:separator]}"
error_count = 0
file = params[:file]
encoding = params[:encoding]
Method create
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def create
authorize! :manage, User
set_page_title 'New user'
- 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_selected_attributes
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def update_selected_attributes
authorize! :manage_master_data, :all
@pemodule = Pemodule.find(params[:module_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 display_balancing_output
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def display_balancing_output(module_project)
#pbs_project_element = @pbs_project_element || @project.root_component
pbs_project_element = current_component
res = String.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 create_inactive_user
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def create_inactive_user
#No authorize required since everyone can ask for new account which will be validated by an Admin
unless (params[:email].blank? || params[:first_name].blank? || params[:last_name].blank? || params[:login_name].blank?)
user = User.where('login_name = ? OR email = ?', params[:login_name], params[:email]).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
Method session_expired?
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def session_expired?
unless load_admin_setting('session_maximum_lifetime')=='unset'
setting_session_maximum_lifetime = load_admin_setting('session_maximum_lifetime').to_i*60*60*24
unless session[:ctime] && (Time.now.utc.to_i - session[:ctime].to_i <= setting_session_maximum_lifetime)
return true
- 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 bindSearch
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindSearch: function(table, $el, internal) {
table = $(table)[0];
$el = $($el); // allow passing a selector string
if (!$el.length) { return; }
var c = table.config,
Function onPlaceLabel
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
onPlaceLabel: function(domElement, node) {
if(!node.getData('prev')) return;
var labels = nodeLabels[node.id],
wrapperStyle = labels.wrapper.style,
labelStyle = labels.label.style,
Function format
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
format: function(table, c, wo) {
var $tbody, tbodyIndex, $rows, rows, $row, $cells, remove, indx,
$table = c.$table,
$tbodies = c.$tbodies,
sortList = c.sortList,
Function initialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function(controller) {
var $ST = $jit.ST;
var config= {
levelsToShow: 2,
Function paint
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
_super.renderer.paint = function(style, anchor, extents) {
var segments = self.getSegments(), p = "", offset = [0,0];
if (extents.xmin < 0) offset[0] = -extents.xmin;
if (extents.ymin < 0) offset[1] = -extents.ymin;
Function paint
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.paint = function(params) {
params = params || {};
var timestamp = params.timestamp, recalc = !(params.recalc === false);
if (!timestamp || self.timestamp !== timestamp) {
var info = _jsPlumb.updateOffset({ elId:_elementId, timestamp:timestamp, recalc:recalc });
Function EventGenerator
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
EventGenerator : function() {
var _listeners = {}, self = this, eventsSuspended = false;
// this is a list of events that should re-throw any errors that occur during their dispatch. as of 1.3.0 this is private to
// jsPlumb, but it seems feasible that people might want to manipulate this list. the thinking is that we don't want event
Function appendToTable
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function appendToTable(table, init) {
var c = table.config,
b = table.tBodies,
rows = [],
c2 = c.cache,
Function applyWidget
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
ts.applyWidget = function(table, init) {
table = $(table)[0]; // in case this is called externally
var c = table.config,
wo = c.widgetOptions,
widgets = [],
Function _traversing_widgets
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
fn._traversing_widgets = function(type, direction, col, row, callback) {
var ga = this.gridmap;
if (!ga[col]) { return; }
var cr, max;