Showing 282 of 417 total issues
Function Deferred
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Deferred: function( func ) {
var doneList = jQuery.Callbacks( "once memory" ),
failList = jQuery.Callbacks( "once memory" ),
progressList = jQuery.Callbacks( "memory" ),
state = "pending",
Consider simplifying this complex logical expression. Open
Open
if ( "getBoundingClientRect" in document.documentElement ) {
jQuery.fn.offset = function( options ) {
var elem = this[0], box;
if ( options ) {
Function doAnimation
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function doAnimation() {
// XXX 'this' does not always have a nodeName when running the
// test suite
if ( optall.queue === false ) {
File gmaps4rails.googlemaps.js
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function() {
var __hasProp = Object.prototype.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
this.Gmaps4RailsGoogle = (function(_super) {
Function add
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function( elem, types, handler, data, selector ) {
var elemData, eventHandle, events,
t, tns, type, namespaces, handleObj,
handleObjIn, quick, handlers, special;
Function AnimateBase
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
svg.Element.AnimateBase = function(node) {
this.base = svg.Element.ElementBase;
this.base(node);
svg.Animations.push(this);
Function filter
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Sizzle.filter = function( expr, set, inplace, not ) {
var match, anyFound,
type, found, item, filter, left,
i, pass,
old = expr,
Function done
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function done( status, nativeStatusText, responses, headers ) {
// Called once
if ( state === 2 ) {
return;
Class Converter
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Converter
class << self
def load(config)
validator = new(config)
Function init
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function( selector, context, rootjQuery ) {
var match, elem, ret, doc;
// Handle $(""), $(null), or $(undefined)
if ( !selector ) {
Function feGaussianBlur
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
svg.Element.feGaussianBlur = function(node) {
this.base = svg.Element.ElementBase;
this.base(node);
function make_fgauss(sigma) {
Function svg
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
svg.Element.svg = function(node) {
this.base = svg.Element.RenderedElementBase;
this.base(node);
this.baseClearContext = this.clearContext;
Class ResultAdapter
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class ResultAdapter
attr_internal :result_groups
def initialize(query, results)
Function dispatch
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event || window.event );
Function ajaxConvert
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ajaxConvert( s, response ) {
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
Function text
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
svg.Element.text = function(node) {
this.base = svg.Element.RenderedElementBase;
this.base(node);
if (node != null) {
File d3.phylogram.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
d3.phylogram.js
Wrapper around a d3-based phylogram (tree where branch lengths are scaled)
Also includes a radial dendrogram visualization (branch lengths not scaled)
along with some helper methods for building angled-branch trees.
Method supported_submit_values_multiple
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def supported_submit_values_multiple
@ling = current_group.lings.find(params[:id])
stale_values = @ling.lings_properties.find(:all, conditions: {property_id: params[:property_id]})
collection_authorize! :manage, stale_values if stale_values
- 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 Gmaps4RailsGoogle
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Gmaps4RailsGoogle() {
Gmaps4RailsGoogle.__super__.constructor.apply(this, arguments);
this.map_options = {
disableDefaultUI: false,
disableDoubleClickZoom: false,
Function data
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}