Showing 282 of 417 total issues
Function RenderedElementBase
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
svg.Element.RenderedElementBase = function(node) {
this.base = svg.Element.ElementBase;
this.base(node);
this.setContext = function(ctx) {
Function removeData
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
Function offset
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.offset = function( options ) {
var elem = this[0];
if ( options ) {
return this.each(function( i ) {
File rgbcolor.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* @link http://www.phpied.com/rgb-color-parser-in-javascript/
* @license Use it if you like it
Function Gmaps4Rails
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Gmaps4Rails() {
this.map = null;
this.serviceObject = null;
this.visibleInfoWindow = null;
this.userLocation = null;
Function remove
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
remove: function( elem, types, handler, selector, mappedTypes ) {
var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
t, tns, type, origType, namespaces, origCount,
j, events, special, handle, eventType, handleObj;
Function setContext
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.setContext = function(ctx) {
// fill
if (this.style('fill').isUrlDefinition()) {
var fs = this.style('fill').getFillStyleDefinition(this);
if (fs != null) ctx.fillStyle = fs;
Consider simplifying this complex logical expression. Open
Open
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !namespaces || namespaces.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
eventType.splice( j--, 1 );
Function step
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
step: function( gotoEnd ) {
var p, n, complete,
t = fxNow || createFxNow(),
done = true,
elem = this.elem,
Consider simplifying this complex logical expression. Open
Open
if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
first.charAt(0) === "<" && !rnocache.test( first ) &&
(jQuery.support.checkClone || !rchecked.test( first )) &&
(jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
Method supported_set_values
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def supported_set_values
@ling = current_group.lings.find(params[:id])
@depth = @ling.depth
@categories = current_group.categories.at_depth(@depth)
session[:category_id] = params[:category_id] if params[:category_id]
Function setContext
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.setContext = function(ctx) {
// initial values
ctx.strokeStyle = 'rgba(0,0,0,0)';
ctx.lineCap = 'butt';
ctx.lineJoin = 'miter';
Function CHILD
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CHILD: function( elem, match ) {
var first, last,
doneName, parent, cache,
count, diff,
type = match[1],
Method supported_submit_values
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def supported_submit_values
@ling = current_group.lings.find(params[:id])
fresh_vals = LingsProperty.find(:all,
:conditions => {ling_id: @ling.id, property_id: params[:property_id]})
if fresh_vals.count > 1
- 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 adjustMapToBounds
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Gmaps4Rails.prototype.adjustMapToBounds = function() {
var bound, circle, map_center, point, polygon, polygon_points, polyline, polyline_points, _i, _j, _k, _l, _len, _len2, _len3, _len4, _len5, _len6, _m, _n, _ref, _ref2, _ref3, _ref4;
if (this.map_options.auto_adjust || this.map_options.bounds !== null) {
this.boundsObject = this.createLatLngBounds();
}
Function ajaxHandleResponses
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ajaxHandleResponses( s, jqXHR, responses ) {
var contents = s.contents,
dataTypes = s.dataTypes,
responseFields = s.responseFields,
Function domManip
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
domManip: function( args, table, callback ) {
var results, first, fragment, parent,
value = args[0],
scripts = [];
Function handleRemote
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleRemote: function(element) {
var method, url, data,
crossDomain = element.data('cross-domain') || null,
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType),
options;
Function handleRemote
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleRemote: function(element) {
var method, url, data,
crossDomain = element.data('cross-domain') || null,
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType),
options;
Function GradientBase
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
svg.Element.GradientBase = function(node) {
this.base = svg.Element.ElementBase;
this.base(node);
this.gradientUnits = this.attribute('gradientUnits').valueOrDefault('objectBoundingBox');