wbrefvem/corkboard

View on GitHub

Showing 153 of 212 total issues

Consider simplifying this complex logical expression.
Open

        if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12) {
            days = 31;
        }
        else if (month==4 || month==6 || month==9 || month==11) {
            days = 30;
Severity: Major
Found in static/admin/js/calendar.js - About 1 hr to fix

    Function init has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        init: function() {
            // Get admin_media_prefix by grabbing it off the window object. It's
            // set in the admin/base.html template, so if it's not there, someone's
            // overridden the template. In that case, we'll set a clearly-invalid
            // value in the hopes that someone will examine HTTP requests and see it.
    Severity: Minor
    Found in static/admin/js/admin/DateTimeShortcuts.js - About 55 mins to fix

    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 handler has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

            handler: function(bits) {
                var hour = parseInt(bits[1]);
                var mins = parseInt(bits[2]);
                if (mins < 10) {
                    mins = '0' + mins;
    Severity: Minor
    Found in static/admin/js/timeparse.js - About 55 mins to fix

    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 findPosX has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    function findPosX(obj) {
        var curleft = 0;
        if (obj.offsetParent) {
            while (obj.offsetParent) {
                curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft);
    Severity: Minor
    Found in static/admin/js/core.js - About 55 mins to fix

    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 findPosY has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    function findPosY(obj) {
        var curtop = 0;
        if (obj.offsetParent) {
            while (obj.offsetParent) {
                curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop);
    Severity: Minor
    Found in static/admin/js/core.js - About 55 mins to fix

    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 access has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
    Severity: Major
    Found in static/admin/js/jquery.js - About 50 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if ( elem && elem.parentNode ) {
                              // Handle the case where IE, Opera, and Webkit return items
                              // by name instead of ID
                              if ( elem.id === m ) {
                                  results.push( elem );
      Severity: Major
      Found in static/admin/js/jquery.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
                                contains( context, elem ) && elem.id === m ) {
                                results.push( elem );
                                return results;
                            }
        Severity: Major
        Found in static/admin/js/jquery.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  while ( j-- ) {
                                      if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
                                          elem.removeChild( tbody );
                                      }
                                  }
          Severity: Major
          Found in static/admin/js/jquery.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ( !xhrCallbacks ) {
                                            xhrCallbacks = {};
                                            jQuery( window ).unload( xhrOnUnloadAbort );
                                        }
            Severity: Major
            Found in static/admin/js/jquery.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ( cache[1] === true ) {
                                              return true;
                                          }
              Severity: Major
              Found in static/admin/js/jquery.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if ( !(unmatched[i] || setMatched[i]) ) {
                                                setMatched[i] = pop.call( results );
                                            }
                Severity: Major
                Found in static/admin/js/jquery.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                      if ( xhr.readyState !== 4 ) {
                                                          xhr.abort();
                                                      }
                  Severity: Major
                  Found in static/admin/js/jquery.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
                                                cur += clazz + " ";
                                            }
                    Severity: Major
                    Found in static/admin/js/jquery.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
                                                              return false;
                                                          }
                      Severity: Major
                      Found in static/admin/js/jquery.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ( hasScripts ) {
                                                    jQuery.merge( scripts, getAll( node, "script" ) );
                                                }
                        Severity: Major
                        Found in static/admin/js/jquery.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if ( (data = cache[1]) === true || data === cachedruns ) {
                                                          return data === true;
                                                      }
                          Severity: Major
                          Found in static/admin/js/jquery.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if ( deleteExpando ) {
                                                        delete elem[ internalKey ];
                            
                                                    } else if ( typeof elem.removeAttribute !== core_strundefined ) {
                                                        elem.removeAttribute( internalKey );
                            Severity: Major
                            Found in static/admin/js/jquery.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if ( conv && s["throws"] ) {
                                                      response = conv( response );
                                                  } else {
                                                      try {
                                                          response = conv( response );
                              Severity: Major
                              Found in static/admin/js/jquery.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                    if ( xhrOnUnloadAbort ) {
                                                                        delete xhrCallbacks[ handle ];
                                                                    }
                                Severity: Major
                                Found in static/admin/js/jquery.js - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language