rosedu/wouso

View on GitHub

Showing 551 of 2,707 total issues

Function Sizzle has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Sizzle( selector, context, results, seed ) {
    var match, elem, m, nodeType,
        // QSA vars
        i, groups, old, nid, newContext, newSelector;

Severity: Major
Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 3 hrs to fix

    Function buildFragment has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        buildFragment: function( elems, context, scripts, selection ) {
            var j, elem, contains,
                tmp, tag, tbody, wrap,
                l = elems.length,
    
    
    Severity: Major
    Found in wouso/resources/static/js/jquery.js - About 2 hrs to fix

      Function buildFragment has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          buildFragment: function( elems, context, scripts, selection ) {
              var j, elem, contains,
                  tmp, tag, tbody, wrap,
                  l = elems.length,
      
      
      Severity: Major
      Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 2 hrs to fix

        Function add has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            add: function( elem, types, handler, data, selector ) {
                var tmp, events, t, handleObjIn,
                    special, eventHandle, handleObj,
                    handlers, type, namespaces, origType,
                    elemData = jQuery._data( elem );
        Severity: Major
        Found in wouso/resources/static/js/jquery.js - About 2 hrs to fix

          Function add has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              add: function( elem, types, handler, data, selector ) {
                  var tmp, events, t, handleObjIn,
                      special, eventHandle, handleObj,
                      handlers, type, namespaces, origType,
                      elemData = jQuery._data( elem );
          Severity: Major
          Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 2 hrs to fix

            Function try_using_truncate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

            def try_using_truncate(username, first_name, last_name, email, password, cookie):
                (username, ret) = try_using_truncate_no_recurse(username, first_name, last_name, email, password)
            
                if ret == OP_SUCCESS:
                    return (username, True)
            Severity: Minor
            Found in wouso/utils/add_users_force.py - About 2 hrs 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 manage_player has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

            def manage_player(request, player_id):
                player = get_object_or_404(Player, pk=player_id)
                player = player.get_extension(SpecialQuestUser)
                tasks_not_done = SpecialQuestTask.objects.exclude(id__in=player.done_tasks.all().values('id')).all()
            
            
            Severity: Minor
            Found in wouso/games/specialquest/cpanel.py - About 2 hrs 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 try_using_truncate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

            def try_using_truncate(username, first_name, last_name, email, password, cookie):
                (username, ret) = try_using_truncate_no_recurse(username, first_name, last_name, email, password)
            
                if ret == OP_SUCCESS:
                    return (username, True)
            Severity: Minor
            Found in wouso/utils/add_users_force_to_race.py - About 2 hrs 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

            File models.py has 283 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            from django.db.models import Sum
            import logging
            import sys
            from datetime import datetime, timedelta
            from django.db import models
            Severity: Minor
            Found in wouso/interface/top/models.py - About 2 hrs to fix

              Function matcherFromGroupMatchers has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                  var bySet = setMatchers.length > 0,
                      byElement = elementMatchers.length > 0,
                      superMatcher = function( seed, context, xml, results, outermost ) {
                          var elem, j, matcher,
              Severity: Major
              Found in wouso/resources/static/js/jquery.js - About 2 hrs to fix

                Function doSubmit has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function doSubmit() {
                            // make sure form attrs are set
                            var t = $form.attr('target'), a = $form.attr('action');
                
                            // update form attrs in IE friendly way
                Severity: Major
                Found in wouso/resources/static/js/jquery.form.js - About 2 hrs to fix

                  Function matcherFromGroupMatchers has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                      var bySet = setMatchers.length > 0,
                          byElement = elementMatchers.length > 0,
                          superMatcher = function( seed, context, xml, results, outermost ) {
                              var elem, j, matcher,
                  Severity: Major
                  Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 2 hrs to fix

                    File models.py has 280 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # coding=utf-8
                    import logging
                    from md5 import md5
                    from datetime import datetime, timedelta
                    from random import shuffle
                    Severity: Minor
                    Found in wouso/core/user/models.py - About 2 hrs to fix

                      Function done has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function done( status, nativeStatusText, responses, headers ) {
                                  var isSuccess, success, error, response, modified,
                                      statusText = nativeStatusText;
                      
                                  // Called once
                      Severity: Major
                      Found in wouso/resources/static/js/jquery.js - About 2 hrs to fix

                        Function done has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function done( status, nativeStatusText, responses, headers ) {
                                    var isSuccess, success, error, response, modified,
                                        statusText = nativeStatusText;
                        
                                    // Called once
                        Severity: Major
                        Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 2 hrs to fix

                          Player has 24 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class Player(models.Model):
                              """ Base class for the game user. This is extended by game specific
                              player models.
                              """
                              user = models.ForeignKey(User, unique=True, related_name="%(class)s_related")
                          Severity: Minor
                          Found in wouso/core/user/models.py - About 2 hrs to fix

                            Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                                if ( postFilter && !postFilter[ expando ] ) {
                                    postFilter = setMatcher( postFilter );
                                }
                                if ( postFinder && !postFinder[ expando ] ) {
                            Severity: Major
                            Found in wouso/resources/static/js/jquery.js - About 2 hrs to fix

                              Function doSort has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function doSort($this, $table) {
                                      var sortColumn = parseFloat($this.attr('data-sortcolumn')),
                                          context = lookupSortContext($table),
                                          bsSort = context.bsSort;
                              
                              
                              Severity: Major
                              Found in wouso/resources/static/js/bootstrap-sortable.js - About 2 hrs to fix

                                Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                                    if ( postFilter && !postFilter[ expando ] ) {
                                        postFilter = setMatcher( postFilter );
                                    }
                                    if ( postFinder && !postFinder[ expando ] ) {
                                Severity: Major
                                Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 2 hrs to fix

                                  Function search has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def search(request):
                                      """ Perform regular search by either first or last name """
                                      logger.debug('Initiating regular search')
                                      form = SearchForm(request.POST)
                                      if form.is_valid():
                                  Severity: Minor
                                  Found in wouso/interface/views.py - About 2 hrs 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language