rosedu/wouso

View on GitHub

Showing 551 of 2,707 total issues

Function remove has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        remove: function(element, label, fn) {
            var timers = element.$timers, ret;
            
            if ( timers ) {
                
Severity: Minor
Found in wouso/resources/static/js/jquery.timers.js - About 1 hr to fix

    Function off has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        off: function( types, selector, fn ) {
            var handleObj, type;
            if ( types && types.preventDefault && types.handleObj ) {
                // ( event )  dispatched jQuery.Event
                handleObj = types.handleObj;
    Severity: Minor
    Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

      Function * has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              "*": [ function( prop, value ) {
                  var tween = this.createTween( prop, value ),
                      target = tween.cur(),
                      parts = rfxnum.exec( value ),
                      unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
      Severity: Minor
      Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

        Function offset has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            offset: function( options ) {
                if ( arguments.length ) {
                    return options === undefined ?
                        this :
                        this.each(function( i ) {
        Severity: Minor
        Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

          Function off has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              off: function( types, selector, fn ) {
                  var handleObj, type;
                  if ( types && types.preventDefault && types.handleObj ) {
                      // ( event )  dispatched jQuery.Event
                      handleObj = types.handleObj;
          Severity: Minor
          Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

            Function refresh has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              ScrollSpy.prototype.refresh = function () {
                var offsetMethod = 'offset'
                var offsetBase   = 0
            
                if (!$.isWindow(this.$scrollElement[0])) {
            Severity: Minor
            Found in wouso/resources/static/js/bootstrap.js - About 1 hr to fix

              Function * has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      "*": [ function( prop, value ) {
                          var tween = this.createTween( prop, value ),
                              target = tween.cur(),
                              parts = rfxnum.exec( value ),
                              unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
              Severity: Minor
              Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                Function offset has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    offset: function( options ) {
                        if ( arguments.length ) {
                            return options === undefined ?
                                this :
                                this.each(function( i ) {
                Severity: Minor
                Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

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

                  jQuery.fn.autocomplete = function(url, options, data) {
                      // Make sure options exists
                      options = options || {};
                      // Set url as option
                      options.url = url;
                  Severity: Minor
                  Found in wouso/resources/static/js/jquery.autocomplete.js - About 1 hr to fix

                    Function test_final_quest_results_view has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def test_final_quest_results_view(self):
                            u1 = self._get_player(1).get_extension(QuestUser)
                            u2 = self._get_player(2).get_extension(QuestUser)
                            r = Race.objects.create(name='rasa_buna', can_play=True)
                            Formula.add('finalquest-ok', expression='points=50*({level}+1)/{level_users}')
                    Severity: Minor
                    Found in wouso/games/quest/tests.py - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                                      support.getById && context.nodeType === 9 && documentIsHTML &&
                                      Expr.relative[ tokens[1].type ] ) {
                      
                                  context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
                      Severity: Major
                      Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                                        support.getById && context.nodeType === 9 && documentIsHTML &&
                                        Expr.relative[ tokens[1].type ] ) {
                        
                                    context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
                        Severity: Major
                        Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                          Function add_user has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def add_user(username, first_name, last_name, email, password, is_active=False, is_staff=False, is_superuser=False):
                          Severity: Major
                          Found in wouso/utils/user_util.py - About 1 hr to fix

                            Function update_user has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def update_user(username, first_name=None, last_name=None, email=None, password=None, is_active=None, is_staff=None, is_superuser=None):
                            Severity: Major
                            Found in wouso/utils/user_util.py - About 1 hr to fix

                              Function main has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def main():
                                  ulist = User.objects.all()
                                  accounts_per_race_dict = {}
                                  for u in ulist:
                                      p = Player.objects.get(user__username=u.username)
                              Severity: Minor
                              Found in wouso/utils/get_stats.py - About 55 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

                              Function __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def __init__(self, data=None, instance=None):
                                      super(EditQuestionForm, self).__init__(data)
                              
                                      for a, i in zip(instance.answers_all, xrange(1, len(instance.answers_all) + 1)):
                                          self.fields['answer_%d' % i] = forms.CharField(max_length=500,
                              Severity: Minor
                              Found in wouso/interface/cpanel/forms.py - About 55 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

                              Function manage_player_set has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def manage_player_set(request, player_id, task_id):
                                  player = get_object_or_404(SpecialQuestUser, id=player_id)
                                  task = get_object_or_404(SpecialQuestTask, id=task_id)
                              
                                  if task not in player.done_tasks.all():
                              Severity: Minor
                              Found in wouso/games/specialquest/cpanel.py - About 55 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

                              Function save has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def save(self):
                                      data = self.cleaned_data
                              
                                      # Create new question instance
                                      self.instance = Question.objects.create()
                              Severity: Minor
                              Found in wouso/interface/cpanel/forms.py - About 55 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

                              Function answered has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def answered(user, question, choice):
                                      correct = False
                                      for i, a in enumerate(question.answers):
                                          if a.id == choice:
                                              if a.correct:
                              Severity: Minor
                              Found in wouso/games/qotd/models.py - About 55 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

                              Function process_request has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def process_request(self, request):
                              #        import pprint; pprint.pprint(request.META['HTTP_AUTHORIZATION']);pprint.pprint(request.POST);
                                      if not request.user.is_anonymous():
                                          try:
                                              profile = request.user.get_profile()
                              Severity: Minor
                              Found in wouso/middleware/seen.py - About 55 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

                              Severity
                              Category
                              Status
                              Source
                              Language