Showing 290 of 682 total issues
Function createTicks
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.jqplot.CategoryAxisRenderer.prototype.createTicks = function() {
// we're are operating on an axis here
var ticks = this._ticks;
var userTicks = this.ticks;
var name = this.name;
Function initBands
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.jqplot.LineRenderer.prototype.initBands = function(options, plot) {
// use bandData if no data specified in bands option
//var bd = this.renderer.bandData;
var bd = options.bandData || [];
var bands = this.renderer.bands;
Function pack
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.jqplot.TableLegendRenderer.prototype.pack = function(offsets) {
if (this.show) {
if (this.placement == 'insideGrid') {
switch (this.location) {
case 'nw':
Function parseOptions
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.parseOptions = function(options){
for (var i=0; i<this.preParseOptionsHooks.hooks.length; i++) {
this.preParseOptionsHooks.hooks[i].call(this, options);
}
for (var i=0; i<$.jqplot.preParseOptionsHooks.length; i++) {
File jquery.form.js
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* jQuery Form Plugin
* version: 2.28 (10-MAY-2009)
* @requires jQuery v1.2.2 or later
*
Function fileUpload
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function fileUpload() {
var form = $form[0];
if ($(':input[name=submit]', form).length) {
alert('Error: Form elements must not be named "submit".');
Function reInitialize
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.reInitialize = function (data, opts) {
// Plot should be visible and have a height and width.
// If plot doesn't have height and width for some
// reason, set it by other means. Plot must not have
// a display:none attribute, however.
Function prep
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
publicMethod.prep = function (object) {
if (!open) {
return;
}
Function activate
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.jqplot.ThemeEngine.prototype.activate = function(plot, name) {
// sometimes need to redraw whole plot.
var redrawPlot = false;
if (!name && this.activeTheme && this.activeTheme._name) {
name = this.activeTheme._name;
File report_sanitizer.rb
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module ReportSanitizer #:nodoc:
class << self
def sanitize(raw)
case
when raw.include?('report_format')
Method get_new_conflicts
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_new_conflicts(old_conflicts, initial_resource, related_resources = [])
current_conflicts = get_current_conflicts(initial_resource, related_resources)
new_conflicts = {}
current_conflicts.keys.each do |entity_desc|
if !old_conflicts.keys.include?(entity_desc)
- 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 compile_all_class_parameters
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Open
def compile_all_class_parameters
unless @all_compiled_class_parameters
@all_compiled_class_parameters = {}
compiled_parameters = self.walk_parent_groups do |group,parents|
- 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
File jqplot.canvasTextRenderer.js
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: 1.0.8
Function init
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.jqplot.ThemeEngine.prototype.init = function() {
// get the Default theme from the current plot settings.
var th = new $.jqplot.Theme({_name:'Default'});
var n, i, nn;
Function LinePattern
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.jqplot.LinePattern = function (ctx, pattern) {
var defaultLinePatterns = {
dotted: [ dotlen, $.jqplot.config.dotGapLength ],
dashed: [ $.jqplot.config.dashLength, $.jqplot.config.gapLength ],
Function setOptions
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Legend.prototype.setOptions = function(options) {
$.extend(true, this, options);
// Try to emulate deprecated behaviour
// if user has specified xoffset or yoffset, copy these to
Function init
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.jqplot.LineRenderer.prototype.init = function(options, plot) {
// Group: Properties
//
options = options || {};
this._type='line';
Function load
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function load () {
var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
active = true;
Consider simplifying this complex logical expression. Open
Open
if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
(t == 'checkbox' || t == 'radio') && !el.checked ||
(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
tag == 'select' && el.selectedIndex == -1))
return null;
Class Report
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Report < ActiveRecord::Base
def self.per_page; SETTINGS.reports_per_page end # Pagination
belongs_to :node, optional: true
# See the after_destroy delete_resources method for more delete_all action