Showing 993 of 2,083 total issues
Consider simplifying this complex logical expression. Open
if ( event.pageX == null && event.clientX != null ) {
var eventDocument = event.target.ownerDocument || document,
doc = eventDocument.documentElement,
body = eventDocument.body;
Function reInitialize
has 125 lines of code (exceeds 25 allowed). Consider refactoring. 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 draw
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.jqplot.PieRenderer.prototype.draw = function (ctx, gd, options, plot) {
var i;
var opts = (options != undefined) ? options : {};
// offset and direction of offset due to legend placement
var offx = 0;
Function init
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.jqplot.DateAxisRenderer.prototype.init = function(options){
// prop: tickRenderer
// A class of a rendering engine for creating the ticks labels displayed on the plot,
// See <$.jqplot.AxisTickRenderer>.
// this.tickRenderer = $.jqplot.AxisTickRenderer;
Class RbStory
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class RbStory < Issue
unloadable
RELEASE_RELATIONSHIP = %w(auto initial continued added)
File rb_story.rb
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
class RbStory < Issue
unloadable
RELEASE_RELATIONSHIP = %w(auto initial continued added)
Function activate
has 118 lines of code (exceeds 25 allowed). Consider refactoring. 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 backlogs_hooks.rb
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
include RbCommonHelper
include ContextMenusHelper
module BacklogsPlugin
module Hooks
Method rebuild
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def self.rebuild(issue)
RbJournal.delete_all(:issue_id => issue.id)
changes = {}
RbJournal::REDMINE_PROPERTIES.each{|prop| changes[prop] = [] }
- 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 position
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.position = function( options ) {
if ( !options || !options.of ) {
return _position.apply( this, arguments );
}
Function init
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.jqplot.MeterGaugeRenderer.prototype.init = function(options) {
// Group: Properties
//
// prop: diameter
// Outer diameter of the meterGauge, auto computed by default
Model
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
RB.Model = RB.Object.create({
initialize: function(el){
this.$ = RB.$(el);
this.el = el;
Function Sizzle
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Sizzle = function( selector, context, results, seed ) {
results = results || [];
context = context || document;
var origContext = context;
Function draw
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.jqplot.DonutRenderer.prototype.draw = function (ctx, gd, options, plot) {
var i;
var opts = (options != undefined) ? options : {};
// offset and direction of offset due to legend placement
var offx = 0;
File jqplot.pyramidGridRenderer.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: 1.0.0
File jqplot.pyramidRenderer.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: 1.0.0
Method add_backlogs_fields
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def add_backlogs_fields
story_trackers = RbStory.trackers
case params[:format]
when 'xml'
- 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 pack
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.jqplot.MekkoLegendRenderer.prototype.pack = function(offsets) {
if (this.show) {
// fake a grid for positioning
var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom};
if (this.placement == 'insideGrid') {
Function SearchResults
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SearchResults(name, mode)
{
/*
var: mode
The mode the search is going to work in, such as "HTML" or "FramedHTML".
Method initialize
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def initialize(project)
@project = project
@statistics = {:succeeded => [], :failed => [], :values => {}}
@active_sprint = @project.active_sprint
- 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"