rosedu/wouso

View on GitHub

Showing 551 of 2,707 total issues

File jquery.js has 6829 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v1.11.1
 * http://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in wouso/resources/static/js/jquery.js - About 2 wks to fix

    File jquery-1.11.1.min.js has 6829 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * jQuery JavaScript Library v1.11.1
     * http://jquery.com/
     *
     * Includes Sizzle.js
    Severity: Major
    Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 2 wks to fix

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

      (function( window ) {
      
      var i,
          support,
          Expr,
      Severity: Major
      Found in wouso/resources/static/js/jquery.js - About 6 days to fix

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

        (function( window ) {
        
        var i,
            support,
            Expr,
        Severity: Major
        Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 6 days to fix

          Function autocomplete has a Cognitive Complexity of 198 (exceeds 5 allowed). Consider refactoring.
          Open

          jQuery.autocomplete = function(input, options) {
              // Create a link to self
              var me = this;
          
              // Create jQuery object for input element
          Severity: Minor
          Found in wouso/resources/static/js/jquery.autocomplete.js - About 4 days 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 bootstrap.js has 1387 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
           * Bootstrap v3.2.0 (http://getbootstrap.com)
           * Copyright 2011-2014 Twitter, Inc.
           * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
           */
          Severity: Major
          Found in wouso/resources/static/js/bootstrap.js - About 3 days to fix

            File views.py has 1025 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import datetime
            from django import forms
            from django.conf import settings
            from django.contrib import messages
            from django.contrib.auth import models as auth
            Severity: Major
            Found in wouso/interface/cpanel/views.py - About 2 days to fix

              Function activity_handler has a Cognitive Complexity of 122 (exceeds 5 allowed). Consider refactoring.
              Open

                  def activity_handler(cls, sender, **kwargs):
                      action = kwargs.get('action', None)
                      player = kwargs.get('user_from', None)
              
                      if player:
              Severity: Minor
              Found in wouso/interface/activity/achievements.py - About 2 days 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 ajaxSubmit has 492 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              $.fn.ajaxSubmit = function(options) {
                  /*jshint scripturl:true */
              
                  // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
                  if (!this.length) {
              Severity: Major
              Found in wouso/resources/static/js/jquery.form.js - About 2 days to fix

                Function autocomplete has 381 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                jQuery.autocomplete = function(input, options) {
                    // Create a link to self
                    var me = this;
                
                    // Create jQuery object for input element
                Severity: Major
                Found in wouso/resources/static/js/jquery.autocomplete.js - About 1 day to fix

                  File jquery.form.js has 767 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*!
                   * jQuery Form Plugin
                   * version: 3.14 (30-JUL-2012)
                   * @requires jQuery v1.3.2 or later
                   *
                  Severity: Major
                  Found in wouso/resources/static/js/jquery.form.js - About 1 day to fix

                    Function fileUploadIframe has 337 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function fileUploadIframe(a) {
                            var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
                            var useProp = !!$.fn.prop;
                    
                            if ($(':input[name=submit],:input[id=submit]', form).length) {
                    Severity: Major
                    Found in wouso/resources/static/js/jquery.form.js - About 1 day to fix

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

                      import random
                      from datetime import datetime, time, timedelta, date
                      from random import shuffle
                      import pickle as pk
                      import sys
                      Severity: Major
                      Found in wouso/games/challenge/models.py - About 1 day to fix

                        File tests.py has 632 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        from datetime import datetime, timedelta
                        from wouso.core.magic.models import Artifact, Spell, SpellHistory
                        from wouso.core.magic.manager import MagicManager
                        from wouso.core.tests import WousoTest
                        from wouso.core import scoring, signals
                        Severity: Major
                        Found in wouso/interface/activity/tests.py - About 1 day to fix

                          Function import_from_file has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def import_from_file(opened_file, proposed_by=None, endorsed_by=None, category=None, tags=None, all_active=False):
                              # read file and parse contents
                              a_saved = True
                              q_saved = True
                              a = {}
                          Severity: Minor
                          Found in wouso/utils/import_questions.py - About 1 day 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 ajax has 240 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              ajax: function( url, options ) {
                          
                                  // If url is an object, simulate pre-1.5 signature
                                  if ( typeof url === "object" ) {
                                      options = url;
                          Severity: Major
                          Found in wouso/resources/static/js/jquery.js - About 1 day to fix

                            Function ajax has 240 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                ajax: function( url, options ) {
                            
                                    // If url is an object, simulate pre-1.5 signature
                                    if ( typeof url === "object" ) {
                                        options = url;
                            Severity: Major
                            Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 day to fix

                              Function setDocument has 216 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              setDocument = Sizzle.setDocument = function( node ) {
                                  var hasCompare,
                                      doc = node ? node.ownerDocument || node : preferredDoc,
                                      parent = doc.defaultView;
                              
                              
                              Severity: Major
                              Found in wouso/resources/static/js/jquery.js - About 1 day to fix

                                Function setDocument has 216 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                setDocument = Sizzle.setDocument = function( node ) {
                                    var hasCompare,
                                        doc = node ? node.ownerDocument || node : preferredDoc,
                                        parent = doc.defaultView;
                                
                                
                                Severity: Major
                                Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 day to fix

                                  Function import_questions_from_file has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def import_questions_from_file(f, proposed_by=None, endorsed_by=None, category=None, tag=None, active=False):
                                      # read file and parse contents
                                      a_saved = True
                                      q_saved = True
                                      a = {}
                                  Severity: Minor
                                  Found in wouso/utils/add_questions.py - About 1 day 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