Showing 157 of 179 total issues
File jquery.js
has 6116 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* jQuery JavaScript Library v1.6.1
* http://jquery.com/
*
* Copyright 2011, John Resig
Function jQuery
has 571 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var jQuery = (function() {
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
Function ajax
has 239 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ajax: function( url, options ) {
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
options = url;
Function tipTip
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.tipTip = function(options) {
var defaults = {
activation: "hover",
keepAlive: false,
maxWidth: "200px",
Function support
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.support = (function() {
var div = document.createElement( "div" ),
documentElement = document.documentElement,
all,
Consider simplifying this complex logical expression. Open
Open
if ( event.pageX == null && event.clientX != null ) {
var eventDocument = event.target.ownerDocument || document,
doc = eventDocument.documentElement,
body = eventDocument.body;
Function Sizzle
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Sizzle = function( selector, context, results, seed ) {
results = results || [];
context = context || document;
var origContext = context;
Function send
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send: function( headers, complete ) {
// Get a new xhr
var xhr = s.xhr(),
handle,
Function remove
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
remove: function( elem, types, handler, pos ) {
// don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
Function trigger
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
trigger: function( event, data, elem, onlyHandlers ) {
// Event object or event type
var type = event.type || event,
namespaces = [],
exclusive;
Function animate
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
animate: function( prop, speed, easing, callback ) {
var optall = jQuery.speed(speed, easing, callback);
if ( jQuery.isEmptyObject( prop ) ) {
return this.each( optall.complete, [ false ] );
Function clean
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
clean: function( elems, context, fragment, scripts ) {
var checkScriptType;
context = context || document;
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 add
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function( elem, types, handler, data ) {
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
Function active_tiptip
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function active_tiptip(){
opts.enter.call(this);
tiptip_content.html(org_title);
tiptip_holder.hide().removeAttr("class").css("margin","0");
tiptip_arrow.removeAttr("style");
Method create
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
def create
if params[:auth_token].blank?
render :status => 422, :xml => <<-EOS
<error>#{t(:message_token_missing_parametr)}</error>
EOS
- 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 filter
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Sizzle.filter = function( expr, set, inplace, not ) {
var match, anyFound,
old = expr,
result = [],
curLoop = set,
Function done
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function done( status, statusText, responses, headers ) {
// Called once
if ( state === 2 ) {
return;
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 ) {
Method validate_macro_step
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def validate_macro_step
return if self.record_type.blank? || !self.errors[:record_type].blank?
record = build
- 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"