rosedu/wouso

View on GitHub

Showing 385 of 2,707 total issues

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

class DeleteFileView(DeleteView):
    model = File
    success_url = reverse_lazy('files')

    def get(self, *args, **kwargs):
Severity: Major
Found in wouso/interface/apps/files/cpanel_views.py and 8 other locations - About 45 mins to fix
wouso/games/quiz/cpanel_views.py on lines 41..46
wouso/games/quiz/cpanel_views.py on lines 84..89
wouso/interface/apps/files/cpanel_views.py on lines 84..89
wouso/interface/apps/lesson/cpanel_views.py on lines 71..76
wouso/interface/apps/lesson/cpanel_views.py on lines 114..119
wouso/interface/apps/lesson/cpanel_views.py on lines 157..162
wouso/interface/forum/cpanel_views.py on lines 47..52
wouso/interface/forum/cpanel_views.py on lines 90..95

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 35.

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

        widgets = {'start': widgets.DateTimePicker(options={"format": "YYYY-MM-DD HH:mm:ss"}),
                   'end': widgets.DateTimePicker(options={"format": "YYYY-MM-DD HH:mm:ss"})
Severity: Minor
Found in wouso/games/quiz/forms.py and 1 other location - About 45 mins to fix
wouso/games/quest/forms.py on lines 11..13

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 35.

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

        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
Severity: Minor
Found in wouso/resources/static/js/bootstrap.js and 1 other location - About 45 mins to fix
wouso/resources/static/js/bootstrap.js on lines 1164..1164

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 50.

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 9 locations. Consider refactoring.
Open

class DeleteCategoryView(DeleteView):
    model = QuizCategory
    success_url = reverse_lazy('manage_quiz_categories')

    def get(self, *args, **kwargs):
Severity: Major
Found in wouso/games/quiz/cpanel_views.py and 8 other locations - About 45 mins to fix
wouso/games/quiz/cpanel_views.py on lines 41..46
wouso/interface/apps/files/cpanel_views.py on lines 41..46
wouso/interface/apps/files/cpanel_views.py on lines 84..89
wouso/interface/apps/lesson/cpanel_views.py on lines 71..76
wouso/interface/apps/lesson/cpanel_views.py on lines 114..119
wouso/interface/apps/lesson/cpanel_views.py on lines 157..162
wouso/interface/forum/cpanel_views.py on lines 47..52
wouso/interface/forum/cpanel_views.py on lines 90..95

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 35.

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

        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
Severity: Minor
Found in wouso/resources/static/js/bootstrap.js and 1 other location - About 45 mins to fix
wouso/resources/static/js/bootstrap.js on lines 1165..1165

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 50.

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 9 locations. Consider refactoring.
Open

class DeleteForumCategoryView(DeleteView):
    model = Category
    success_url = reverse_lazy('manage_forum_categories')

    def get(self, *args, **kwargs):
Severity: Major
Found in wouso/interface/forum/cpanel_views.py and 8 other locations - About 45 mins to fix
wouso/games/quiz/cpanel_views.py on lines 41..46
wouso/games/quiz/cpanel_views.py on lines 84..89
wouso/interface/apps/files/cpanel_views.py on lines 41..46
wouso/interface/apps/files/cpanel_views.py on lines 84..89
wouso/interface/apps/lesson/cpanel_views.py on lines 71..76
wouso/interface/apps/lesson/cpanel_views.py on lines 114..119
wouso/interface/apps/lesson/cpanel_views.py on lines 157..162
wouso/interface/forum/cpanel_views.py on lines 47..52

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 35.

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 9 locations. Consider refactoring.
Open

class DeleteForumView(DeleteView):
    model = Forum
    success_url = reverse_lazy('forum')

    def get(self, *args, **kwargs):
Severity: Major
Found in wouso/interface/forum/cpanel_views.py and 8 other locations - About 45 mins to fix
wouso/games/quiz/cpanel_views.py on lines 41..46
wouso/games/quiz/cpanel_views.py on lines 84..89
wouso/interface/apps/files/cpanel_views.py on lines 41..46
wouso/interface/apps/files/cpanel_views.py on lines 84..89
wouso/interface/apps/lesson/cpanel_views.py on lines 71..76
wouso/interface/apps/lesson/cpanel_views.py on lines 114..119
wouso/interface/apps/lesson/cpanel_views.py on lines 157..162
wouso/interface/forum/cpanel_views.py on lines 90..95

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 35.

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 9 locations. Consider refactoring.
Open

class DeleteLessonView(DeleteView):
    model = Lesson
    success_url = reverse_lazy('lessons')

    def get(self, *args, **kwargs):
Severity: Major
Found in wouso/interface/apps/lesson/cpanel_views.py and 8 other locations - About 45 mins to fix
wouso/games/quiz/cpanel_views.py on lines 41..46
wouso/games/quiz/cpanel_views.py on lines 84..89
wouso/interface/apps/files/cpanel_views.py on lines 41..46
wouso/interface/apps/files/cpanel_views.py on lines 84..89
wouso/interface/apps/lesson/cpanel_views.py on lines 114..119
wouso/interface/apps/lesson/cpanel_views.py on lines 157..162
wouso/interface/forum/cpanel_views.py on lines 47..52
wouso/interface/forum/cpanel_views.py on lines 90..95

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 35.

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 9 locations. Consider refactoring.
Open

class DeleteTagView(DeleteView):
    model = LessonTag
    success_url = reverse_lazy('manage_lesson_tags')

    def get(self, *args, **kwargs):
Severity: Major
Found in wouso/interface/apps/lesson/cpanel_views.py and 8 other locations - About 45 mins to fix
wouso/games/quiz/cpanel_views.py on lines 41..46
wouso/games/quiz/cpanel_views.py on lines 84..89
wouso/interface/apps/files/cpanel_views.py on lines 41..46
wouso/interface/apps/files/cpanel_views.py on lines 84..89
wouso/interface/apps/lesson/cpanel_views.py on lines 71..76
wouso/interface/apps/lesson/cpanel_views.py on lines 114..119
wouso/interface/forum/cpanel_views.py on lines 47..52
wouso/interface/forum/cpanel_views.py on lines 90..95

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 35.

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

        widgets = {
                'start': widgets.DateTimePicker(options={"format": "YYYY-MM-DD HH:mm:ss"}),
                'end': widgets.DateTimePicker(options={"format": "YYYY-MM-DD HH:mm:ss"})
Severity: Minor
Found in wouso/games/quest/forms.py and 1 other location - About 45 mins to fix
wouso/games/quiz/forms.py on lines 65..66

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 35.

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 9 locations. Consider refactoring.
Open

class DeleteQuizView(DeleteView):
    model = Quiz
    success_url = reverse_lazy('list_quizzes')

    def get(self, *args, **kwargs):
Severity: Major
Found in wouso/games/quiz/cpanel_views.py and 8 other locations - About 45 mins to fix
wouso/games/quiz/cpanel_views.py on lines 84..89
wouso/interface/apps/files/cpanel_views.py on lines 41..46
wouso/interface/apps/files/cpanel_views.py on lines 84..89
wouso/interface/apps/lesson/cpanel_views.py on lines 71..76
wouso/interface/apps/lesson/cpanel_views.py on lines 114..119
wouso/interface/apps/lesson/cpanel_views.py on lines 157..162
wouso/interface/forum/cpanel_views.py on lines 47..52
wouso/interface/forum/cpanel_views.py on lines 90..95

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 35.

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

            a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
Severity: Minor
Found in wouso/resources/static/js/jquery.form.js and 1 other location - About 45 mins to fix
wouso/resources/static/js/jquery.form.js on lines 807..807

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 50.

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

            if not player.magic.has_modifier('ach-use-all-mass'):
                if used_all_spells(player, True):
                    cls.earn_achievement(player, 'ach-use-all-mass')
Severity: Minor
Found in wouso/interface/activity/achievements.py and 1 other location - About 45 mins to fix
wouso/interface/activity/achievements.py on lines 368..370

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 35.

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 i in range(correct_answers):
            Answer.objects.create(question=q, correct=True, text='correct %d' % i)
Severity: Minor
Found in wouso/games/challenge/tests.py and 1 other location - About 45 mins to fix
wouso/games/challenge/tests.py on lines 354..355

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 35.

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

        return Challenge.objects.filter(date__lt=yesterday).filter(Q(status='A') | Q(status='L'))
Severity: Minor
Found in wouso/games/challenge/models.py and 1 other location - About 45 mins to fix
wouso/interface/apps/statistics/views.py on lines 63..64

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 35.

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

        if self.chall.status == 'L':
            messages.error(request, _('The challenge was not accepted yet!'))
            return redirect('challenge_index_view')
Severity: Minor
Found in wouso/games/challenge/views.py and 1 other location - About 45 mins to fix
wouso/games/challenge/views.py on lines 76..78

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 35.

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 i in range(wrong_answers):
            Answer.objects.create(question=q, correct=False, text='wrong %d' % i)
Severity: Minor
Found in wouso/games/challenge/tests.py and 1 other location - About 45 mins to fix
wouso/games/challenge/tests.py on lines 352..353

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 35.

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

            if not player.magic.has_modifier('ach-use-all-spells'):
                if used_all_spells(player, False):
                    cls.earn_achievement(player, 'ach-use-all-spells')
Severity: Minor
Found in wouso/interface/activity/achievements.py and 1 other location - About 45 mins to fix
wouso/interface/activity/achievements.py on lines 373..375

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 35.

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

        challenges_played_week = Challenge.objects.filter(date__gte=week_start).filter(
            Q(status='P') | Q(status='D'))
Severity: Minor
Found in wouso/interface/apps/statistics/views.py and 1 other location - About 45 mins to fix
wouso/games/challenge/models.py on lines 288..288

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 35.

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

            self.fields['answer_%d' % i] = forms.CharField(max_length=500,
                                                           widget=forms.Textarea, required=False)
Severity: Minor
Found in wouso/interface/cpanel/forms.py and 1 other location - About 45 mins to fix
wouso/interface/apps/qproposal/forms.py on lines 16..17

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 35.

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

Severity
Category
Status
Source
Language