angelakuo/citydogshare

View on GitHub

Showing 2,136 of 3,976 total issues

Function toast has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

Materialize.toast = function (message, displayLength, className, completeCallback) {
    className = className || "";

    var container = document.getElementById('toast-container');

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 trigger has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    trigger: function( event, data, elem, onlyHandlers ) {
        var handle, ontype, cur,
            bubbleType, special, tmp, i,
            eventPath = [ elem || document ],
            type = hasOwn.call( event, "type" ) ? event.type : event,

    Function Animation has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Animation( elem, properties, options ) {
        var result,
            stopped,
            index = 0,
            length = Animation.prefilters.length,

      Function Animation has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function Animation( elem, properties, options ) {
          var result,
              stopped,
              index = 0,
              length = Animation.prefilters.length,

        Function Animation has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Animation( elem, properties, options ) {
            var result,
                stopped,
                index = 0,
                length = Animation.prefilters.length,

          Consider simplifying this complex logical expression.
          Open

                                      if (((key >= KEY0 && key <= KEY9) || (key >= _KEY0 && key <= _KEY9)) || (key === BACKSPACE || key === DEL)) {
                                          pos = getCaretPos(this);
                                          digit = (key !== BACKSPACE && key !== DEL) ? String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key) : '_';
          
                                          if ((key === BACKSPACE || key === DEL) && pos) {

            Function _fetchEventSource has 91 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function _fetchEventSource(source, callback) {
                    var i;
                    var fetchers = FC.sourceFetchers;
                    var res;
            
            

              Function identifierToken has 91 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  Lexer.prototype.identifierToken = function() {
                    var alias, colon, colonOffset, forcedIdentifier, id, idLength, input, match, poppedToken, prev, ref2, ref3, ref4, ref5, tag, tagToken;
                    if (!(match = IDENTIFIER.exec(this.chunk))) {
                      return 0;
                    }

                Function toast has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                ;Materialize.toast = function (message, displayLength, className, completeCallback) {
                    className = className || "";
                
                    var container = document.getElementById('toast-container');
                
                

                  Function toast has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Materialize.toast = function (message, displayLength, className, completeCallback) {
                      className = className || "";
                  
                      var container = document.getElementById('toast-container');
                  
                  

                    Function toast has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Materialize.toast = function (message, displayLength, className, completeCallback) {
                        className = className || "";
                    
                        var container = document.getElementById('toast-container');
                    
                    

                      Function complete has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              var complete = (function( data, next, active, queue, thumb ) {
                      
                                  return function() {
                      
                                      var win;

                        Function init has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                init : function() {
                        
                                    if ( lightbox.initialized ) {
                                        return;
                                    }

                          Function buildSegDragListener has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              buildSegDragListener: function(seg) {
                                  var _this = this;
                                  var view = this.view;
                                  var calendar = view.calendar;
                                  var el = seg.el;

                            Function handleEvents has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                this.handleEvents = function(){
                                  var SELS = self.SELS;
                            
                                  self.$document.on('click', SELS.CHIPS, function(e){
                                    $(e.target).find(SELS.INPUT).focus();

                              Function handleEvents has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  this.handleEvents = function(){
                                    var SELS = self.SELS;
                              
                                    self.$document.on('click', SELS.CHIPS, function(e){
                                      $(e.target).find(SELS.INPUT).focus();

                                Function handleEvents has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    this.handleEvents = function(){
                                      var SELS = self.SELS;
                                
                                      self.$document.on('click', SELS.CHIPS, function(e){
                                        $(e.target).find(SELS.INPUT).focus();

                                  Function trigger has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      trigger: function( event, data, elem, onlyHandlers ) {
                                  
                                          var i, cur, tmp, bubbleType, ontype, handle, special,
                                              eventPath = [ elem || document ],
                                              type = hasOwn.call( event, "type" ) ? event.type : event,

                                    Function trigger has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        trigger: function( event, data, elem, onlyHandlers ) {
                                    
                                            var i, cur, tmp, bubbleType, ontype, handle, special,
                                                eventPath = [ elem || document ],
                                                type = hasOwn.call( event, "type" ) ? event.type : event,

                                      Function init has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          init : function(options) {
                                            var defaults = {
                                              onShow: null
                                            };
                                            options = $.extend(defaults, options);
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language