angelakuo/citydogshare

View on GitHub

Showing 2,136 of 3,976 total issues

Function units_month__handleStrictParse has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function units_month__handleStrictParse(monthName, format, strict) {
        var i, ii, mom, llc = monthName.toLocaleLowerCase();
        if (!this._monthsParse) {
            // this is not used
            this._monthsParse = [];

    Function clip has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    return $.effects.effect.clip = function( o, done ) {
        // Create element
        var el = $( this ),
            props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
            mode = $.effects.setMode( el, o.mode || "hide" ),

      Function clip has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      return $.effects.effect.clip = function( o, done ) {
          // Create element
          var el = $( this ),
              props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
              mode = $.effects.setMode( el, o.mode || "hide" ),

        Function enter has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                enter: function( callback ) {
        
                    fullscreen.beforeEnter(function() {
        
                        callback = fullscreen.parseCallback( callback, true );

          Function item has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                                      item: function( targetDate ) {
          
                                          // Convert the time date from a relative date to a target date.
                                          targetDate = calendar.create([ viewsetObject.year, viewsetObject.month, targetDate + ( settings.firstDay ? 1 : 0 ) ])
          
          

            Function item has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                                        item: function( targetDate ) {
            
                                            // Convert the time date from a relative date to a target date.
                                            targetDate = calendar.create([ viewsetObject.year, viewsetObject.month, targetDate + ( settings.firstDay ? 1 : 0 ) ])
            
            

              Function clip has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var effectClip = $.effects.effect.clip = function( o, done ) {
                  // Create element
                  var el = $( this ),
                      props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
                      mode = $.effects.setMode( el, o.mode || "hide" ),

                Function toHaveBeenCalledTimes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                getJasmineRequireObj().toHaveBeenCalledTimes = function(j$) {
                
                  var getErrorMsg = j$.formatErrorMsg('<toHaveBeenCalledTimes>', 'expect(<spyObj>).toHaveBeenCalledTimes(<Number>)');
                
                  function toHaveBeenCalledTimes() {

                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

                Method edit has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  def edit
                    flash[:notice] = "All information added here will be visible to other members."
                    if @current_user.dogs.empty?
                      flash[:notice] = "Please update your zipcode to add a dog. All information added here will be visible to other members."
                    end
                Severity: Minor
                Found in app/controllers/users_controller.rb - About 1 hr 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

                Method no_overlap has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  def no_overlap
                    names = []
                    dogs.each do |dog|
                      dog.events.each do |event|
                        if overlap?(event) and event.id != self.id
                Severity: Minor
                Found in app/models/event.rb - About 1 hr 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 style has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    style: function( elem, name, value, extra ) {
                
                        // Don't set styles on text and comment nodes
                        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                            return;

                  Function setOptions has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function setOptions(newOptionHash) {
                          var optionCnt = 0;
                          var optionName;
                  
                          for (optionName in newOptionHash) {

                    Function style has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        style: function( elem, name, value, extra ) {
                    
                            // Don't set styles on text and comment nodes
                            if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                                return;

                      Function outdentToken has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) {
                            var decreasedIndent, dent, lastIndent, ref2;
                            decreasedIndent = this.indent - moveOut;
                            while (moveOut > 0) {
                              lastIndent = this.indents[this.indents.length - 1];

                        Function compileNode has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            Arr.prototype.compileNode = function(o) {
                              var answer, compiledObjs, fragments, index, j, len1, obj;
                              if (!this.objects.length) {
                                return [this.makeCode('[]')];
                              }

                          Function ReportDispatcher has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          getJasmineRequireObj().ReportDispatcher = function() {
                            function ReportDispatcher(methods) {
                          
                              var dispatchedMethods = methods || [];
                          
                          

                            Function ObjectContaining has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            getJasmineRequireObj().ObjectContaining = function(j$) {
                            
                              function ObjectContaining(sample) {
                                this.sample = sample;
                              }

                              Function specDone has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  this.specDone = function(result) {
                                    if(noExpectations(result) && typeof console !== 'undefined' && typeof console.error !== 'undefined') {
                                      console.error('Spec \'' + result.fullName + '\' has no expectations.');
                                    }
                              
                              

                                Function parse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        JSON.parse = function (text, reviver) {
                                
                                // The parse method takes a text and an optional reviver function, and returns
                                // a JavaScript value if the text is a valid JSON text.
                                
                                

                                  Function deactivate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  DatePicker.prototype.deactivate = function( type, datesToDisable ) {
                                  
                                      var calendar = this,
                                          disabledItems = calendar.item.disable.slice(0)
                                  
                                  
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language