fairplaysk/datacamp

View on GitHub

Showing 277 of 350 total issues

Avoid deeply nested control flow statements.
Open

                        for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
                            if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
                                setClass += " " + classNames[c];
                            }
                        }
Severity: Major
Found in app/assets/javascripts/jquery.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if ( !match ) {
                            anyFound = found = true;
    
                        } else if ( match === true ) {
                            continue;
    Severity: Major
    Found in app/assets/javascripts/jquery.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
                                  tbody[ j ].parentNode.removeChild( tbody[ j ] );
                              }
      Severity: Major
      Found in app/assets/javascripts/jquery.js - About 45 mins to fix

        Function dirNodeCheck has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
        Severity: Minor
        Found in app/assets/javascripts/jquery.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if ( special.remove ) {
                                      special.remove.call( elem, handleObj );
                                  }
          Severity: Major
          Found in app/assets/javascripts/jquery.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if ( elem.id !== match[2] ) {
                                        return rootjQuery.find( selector );
                                    }
            Severity: Major
            Found in app/assets/javascripts/jquery.js - About 45 mins to fix

              Function dirCheck has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
              Severity: Minor
              Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if ( pos == null ) {
                                            eventType.splice( j--, 1 );
                                        }
                Severity: Major
                Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if ( special[ type ] ) {
                                              jQuery.event.remove( elem, type );
                  
                                          } else {
                                              jQuery.removeEvent( elem, type, data.handle );
                  Severity: Major
                  Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                    Method visible_field_descriptions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def visible_field_descriptions(type = nil, limit = nil)
                        type ||= :listing
                        where = "is_visible_in_#{type.to_s}".to_sym
                        @field_descriptions_cache = {} unless @field_descriptions_cache
                        if @field_descriptions_cache[type]
                    Severity: Minor
                    Found in app/models/dataset_description.rb - About 45 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

                    Avoid deeply nested control flow statements.
                    Open

                                            for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
                                                className = className.replace(" " + classNames[c] + " ", " ");
                                            }
                    Severity: Major
                    Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if ( typeof cur !== "string" ) {
                                              if ( elem === cur ) {
                                                  match = true;
                                                  break;
                                              }
                      Severity: Major
                      Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                        Method create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def create
                            logout_keeping_session!
                            user = User.authenticate(params[:login], params[:password])
                            if user
                              # Protects against session fixation attacks, causes request forgery
                        Severity: Minor
                        Found in app/controllers/sessions_controller.rb - About 45 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

                        Method log_changes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def log_changes
                            change_details = []
                            changed_attributes.each do |attribute, old_value|
                              next if attribute == "updated_at"
                              next if old_value == self[attribute]
                        Severity: Minor
                        Found in app/models/dataset_description.rb - About 45 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

                        Avoid deeply nested control flow statements.
                        Open

                                                if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && 
                                                        (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
                        
                                                    // Get the specific value for the option
                                                    value = jQuery(option).val();
                        Severity: Major
                        Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                          Function access has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              access: function( elems, key, value, exec, fn, pass ) {
                          Severity: Minor
                          Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                            } else if ( copy !== undefined ) {
                                                target[ name ] = copy;
                                            }
                            Severity: Major
                            Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                              Function CLASS has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      CLASS: function( match, curLoop, inplace, result, not, isXML ) {
                              Severity: Minor
                              Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                                Function ATTR has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        ATTR: function( match, curLoop, inplace, result, not, isXML ) {
                                Severity: Minor
                                Found in app/assets/javascripts/jquery.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if ( ret[r] === ret[n] ) {
                                                              ret.splice(n--, 1);
                                                              break;
                                                          }
                                  Severity: Major
                                  Found in app/assets/javascripts/jquery.js - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language