angelakuo/citydogshare

View on GitHub

Showing 3,976 of 3,976 total issues

Function returnToOriginal has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function returnToOriginal() {

          doneAnimating = false;

          var placeholder = origin.parent('.material-placeholder');

    Function _open has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _open: function( event, target, content ) {
            var tooltipData, tooltip, delayedShow, a11yContent,
                positionOption = $.extend( {}, this.options.position );
    
            if ( !content ) {

      Function buildExpectationResult has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      getJasmineRequireObj().buildExpectationResult = function() {
        function buildExpectationResult(options) {
          var messageFormatter = options.messageFormatter || function() {},
            stackFormatter = options.stackFormatter || function() {};
      
      

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

      getJasmineRequireObj().CallTracker = function(j$) {
      
        function CallTracker() {
          var calls = [];
          var opts = {};

      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 has too many lines. [15/10]
      Open

        def self.convert_age_ranges_to_dob_query(age_ranges_indices)
          age_ranges = [[0, 2], [2, 4], [5, 8], [9, 30]]
          age_query = ""
          selected_counter = 0
          num_selected = age_ranges_indices.length
      Severity: Minor
      Found in app/models/dog.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Assignment Branch Condition size for age is too high. [20.25/15]
      Open

        def age
          now = Time.now.utc.to_date
          now.year - dob.year - ((now.month > dob.month || (now.month == dob.month && now.day >= dob.day)) ? 0 : 1)
        end
      Severity: Minor
      Found in app/models/dog.rb by rubocop

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

      Assignment Branch Condition size for facebook_info_update is too high. [20.27/15]
      Open

        def facebook_info_update(auth)
          self.uid = auth[:uid]
          if(auth[:extra][:raw_info] != nil)
            self.gender = auth[:extra][:raw_info][:gender]
          end
      Severity: Minor
      Found in app/models/user.rb by rubocop

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

      Assignment Branch Condition size for no_overlap is too high. [20.71/15]
      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 by rubocop

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

      Assignment Branch Condition size for filter_by is too high. [20.02/15]
      Open

        def self.filter_by(criteria)
          dogs = Dog.near(criteria[:zipcode], criteria[:radius])
                    .has_mix(criteria[:mix])
                    .has_size(criteria[:size])
                    .has_likes(criteria[:like])
      Severity: Minor
      Found in app/models/dog.rb by rubocop

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

      Method has too many lines. [15/10]
      Open

        def params_hash
          # FullCalendar updates end_date off by 1 day
          if params["fc_update"]
            attributes = 
            { :start_date => params["event"]["start_date"],

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Function translate has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function translate(number, withoutSuffix, key, isFuture) {
              var result = number + ' ';
              switch (key) {
                  case 's':
                      return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';

        Function generate has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            SourceMap.prototype.generate = function(options, code) {
              var buffer, i, j, lastColumn, lastSourceColumn, lastSourceLine, len, len1, lineMap, lineNumber, mapping, needComma, ref, ref1, v3, writingline;
              if (options == null) {
                options = {};
              }

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

              Assign.prototype.compileNode = function(o) {
                var answer, compiledName, isValue, j, name, properties, prototype, ref3, ref4, ref5, ref6, ref7, val, varBase;
                if (isValue = this.variable instanceof Value) {
                  if (this.variable.isArray() || this.variable.isObject()) {
                    return this.compilePatternMatch(o);

            Function getMatcher has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function getMatcher() {
                  var expected = null,
                      errorType = null;
            
                  if (arguments.length == 2) {

              Function createWrapper has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  createWrapper: function( element ) {
              
                      // if the element is already wrapped, return it
                      if ( element.parent().is( ".ui-effects-wrapper" )) {
                          return element.parent();

                Function createWrapper has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    createWrapper: function( element ) {
                
                        // if the element is already wrapped, return it
                        if ( element.parent().is( ".ui-effects-wrapper" )) {
                            return element.parent();

                  Function _setContainment has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _setContainment: function() {
                  
                          var isUserScrollable, c, ce,
                              o = this.options,
                              document = this.document[ 0 ];

                    Function createWrapper has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        createWrapper: function( element ) {
                    
                            // if the element is already wrapped, return it
                            if ( element.parent().is( ".ui-effects-wrapper" )) {
                                return element.parent();

                      Function createWrapper has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          createWrapper: function( element ) {
                      
                              // if the element is already wrapped, return it
                              if ( element.parent().is( ".ui-effects-wrapper" )) {
                                  return element.parent();

                        Function _setContainment has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _setContainment: function() {
                        
                                var isUserScrollable, c, ce,
                                    o = this.options,
                                    document = this.document[ 0 ];
                          Severity
                          Category
                          Status
                          Source
                          Language