rosedu/wouso

View on GitHub

Showing 2,707 of 2,707 total issues

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

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

Function score has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def score(user, game, formula, external_id=None, percents=100, **params):
Severity: Minor
Found in wouso/core/scoring/sm.py - About 45 mins to fix

    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

    Function player has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def player(user, artif_html=None, real_name=False):
        """ Render player name and level image with link to player's profile """
        if not user or isinstance(user, str):
            return ''
    
    
    Severity: Minor
    Found in wouso/core/user/templatetags/user.py - About 45 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

    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

    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

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

    Function sidebar_widget has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def sidebar_widget(context):
        user = context.get('user', None)
        quest = QuestGame.get_current()
    
        if quest is None or user is None or not user.is_authenticated():
    Severity: Minor
    Found in wouso/games/quest/views.py - About 45 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

    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

    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 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 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 DeleteCategoryView(DeleteView):
        model = LessonCategory
        success_url = reverse_lazy('manage_lesson_categories')
    
        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 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

    Function extraInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def extraInfo(self, user_won, user_lost):
            '''returns a string with extra info for a string such as User 1 finished the challenge in $SECONDS seconds
            (or $MINUTES minutes and seconds) and scored X points)'''
    
            def formatTime(seconds):
    Severity: Minor
    Found in wouso/games/challenge/models.py - About 45 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

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

    class QPoolManageTagsView(ListView):
        template_name = 'cpanel/qpool_managetags.html'
        context_object_name = 'tags'
    
        def get_queryset(self):
    Severity: Minor
    Found in wouso/interface/cpanel/views.py and 1 other location - About 45 mins to fix
    wouso/interface/cpanel/views.py on lines 1120..1125

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

    class ReportsView(ListView):
        template_name = 'cpanel/reports.html'
        context_object_name = 'reports'
    
        def get_queryset(self):
    Severity: Minor
    Found in wouso/interface/cpanel/views.py and 1 other location - About 45 mins to fix
    wouso/interface/cpanel/views.py on lines 629..634

    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