rosedu/wouso

View on GitHub

Showing 2,707 of 2,707 total issues

Function attr has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    attr: function( elem, name, value ) {
        var hooks, ret,
            nType = elem.nodeType;

        // don't get/set attributes on text, comment and attribute nodes
Severity: Minor
Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

    Function handlers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        handlers: function( event, handlers ) {
            var sel, handleObj, matches, i,
                handlerQueue = [],
                delegateCount = handlers.delegateCount,
                cur = event.target;
    Severity: Minor
    Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

      Function promise has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      jQuery.ready.promise = function( obj ) {
          if ( !readyList ) {
      
              readyList = jQuery.Deferred();
      
      
      Severity: Minor
      Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            if args.change_password:
                username = args.change_password[0]
                password = args.change_password[1]
                change_password(username, password)
        Severity: Major
        Found in wouso/utils/user_util.py and 2 other locations - About 1 hr to fix
        wouso/utils/user_util.py on lines 316..319
        wouso/utils/user_util.py on lines 321..324

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                for a in apps:
                    if a.management_task:
                        self.stdout.write('%s ...\n' % a.name())
                        a.management_task(stdout=self.stdout)
        Severity: Major
        Found in wouso/core/game/management/commands/wousocron.py and 1 other location - About 1 hr to fix
        wouso/core/game/management/commands/wousocron.py on lines 23..26

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        @permission_required('quest.change_quest')
        def register_results(request, id):
            quest = get_object_or_404(Quest, pk=id)
            quest.register()
            return redirect('quest_home')
        Severity: Major
        Found in wouso/games/quest/cpanel.py and 3 other locations - About 1 hr to fix
        wouso/games/quest/cpanel.py on lines 107..111
        wouso/games/specialquest/cpanel.py on lines 180..184
        wouso/interface/cpanel/views.py on lines 667..673

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        @permission_required('specialquest.change_specialquestuser')
        def group_delete(request, group):
            group = get_object_or_404(SpecialQuestGroup, id=group)
            group.destroy()
            return redirect('specialquest_cpanel_groups')
        Severity: Major
        Found in wouso/games/specialquest/cpanel.py and 3 other locations - About 1 hr to fix
        wouso/games/quest/cpanel.py on lines 107..111
        wouso/games/quest/cpanel.py on lines 113..117
        wouso/interface/cpanel/views.py on lines 667..673

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                if 'game' in params and params['game']:
                    objects = objects.filter(game__name=params['game'])
        Severity: Major
        Found in wouso/interface/cpanel/views.py and 2 other locations - About 1 hr to fix
        wouso/interface/cpanel/views.py on lines 1152..1153
        wouso/interface/cpanel/views.py on lines 1154..1155

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                for t in data['tags']:
                    tag = Tag.objects.get(name=t)
                    self.instance.tags.add(tag)
        Severity: Major
        Found in wouso/interface/cpanel/forms.py and 1 other location - About 1 hr to fix
        wouso/interface/cpanel/forms.py on lines 238..240

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                if 'user_from' in params and params['user_from']:
                    objects = objects.filter(user_from__nickname=params['user_from'])
        Severity: Major
        Found in wouso/interface/cpanel/views.py and 2 other locations - About 1 hr to fix
        wouso/interface/cpanel/views.py on lines 1150..1151
        wouso/interface/cpanel/views.py on lines 1154..1155

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                if 'user_to' in params and params['user_to']:
                    objects = objects.filter(user_from__nickname=params['user_to'])
        Severity: Major
        Found in wouso/interface/cpanel/views.py and 2 other locations - About 1 hr to fix
        wouso/interface/cpanel/views.py on lines 1150..1151
        wouso/interface/cpanel/views.py on lines 1152..1153

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            if args.remove_user_from_race:
                username = args.remove_user_from_race[0]
                race_name = args.remove_user_from_race[1]
                remove_user_from_race(username, race_name)
        Severity: Major
        Found in wouso/utils/user_util.py and 2 other locations - About 1 hr to fix
        wouso/utils/user_util.py on lines 311..314
        wouso/utils/user_util.py on lines 316..319

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        @permission_required('config.change_setting')
        def qpool_delete_tag(request, tag):
            tag_obj = get_object_or_404(Tag, pk=tag)
        
            tag_obj.delete()
        Severity: Major
        Found in wouso/interface/cpanel/views.py and 3 other locations - About 1 hr to fix
        wouso/games/quest/cpanel.py on lines 107..111
        wouso/games/quest/cpanel.py on lines 113..117
        wouso/games/specialquest/cpanel.py on lines 180..184

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                for t in data['tags']:
                    tag = Tag.objects.get(name=t)
                    self.instance.tags.add(tag)
        Severity: Major
        Found in wouso/interface/cpanel/forms.py and 1 other location - About 1 hr to fix
        wouso/interface/cpanel/forms.py on lines 113..115

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        @permission_required('quest.change_quest')
        def quest_bonus(request, id):
            quest = get_object_or_404(Quest, pk=id)
            quest.give_bonus()
            return redirect('quest_home')
        Severity: Major
        Found in wouso/games/quest/cpanel.py and 3 other locations - About 1 hr to fix
        wouso/games/quest/cpanel.py on lines 113..117
        wouso/games/specialquest/cpanel.py on lines 180..184
        wouso/interface/cpanel/views.py on lines 667..673

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            if args.add_user_to_race:
                username = args.add_user_to_race[0]
                race_name = args.add_user_to_race[1]
                add_user_to_race(username, race_name)
        Severity: Major
        Found in wouso/utils/user_util.py and 2 other locations - About 1 hr to fix
        wouso/utils/user_util.py on lines 311..314
        wouso/utils/user_util.py on lines 321..324

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                for g in get_games():
                    if g.management_task:
                        self.stdout.write('%s ...\n' % g.name())
                        g.management_task(stdout=self.stdout)
        Severity: Major
        Found in wouso/core/game/management/commands/wousocron.py and 1 other location - About 1 hr to fix
        wouso/core/game/management/commands/wousocron.py on lines 17..20

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 40.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function show has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Collapse.prototype.show = function () {
            if (this.transitioning || this.$element.hasClass('in')) return
        
            var startEvent = $.Event('show.bs.collapse')
            this.$element.trigger(startEvent)
        Severity: Minor
        Found in wouso/resources/static/js/bootstrap.js - About 1 hr to fix

          Function toggleClass has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              toggleClass: function( value, stateVal ) {
                  var type = typeof value;
          
                  if ( typeof stateVal === "boolean" && type === "string" ) {
                      return stateVal ? this.addClass( value ) : this.removeClass( value );
          Severity: Minor
          Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

            Function html has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                html: function( value ) {
                    return access( this, function( value ) {
                        var elem = this[ 0 ] || {},
                            i = 0,
                            l = this.length;
            Severity: Minor
            Found in wouso/resources/static/js/jquery.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language