rosedu/wouso

View on GitHub

Showing 2,707 of 2,707 total issues

Consider simplifying this complex logical expression.
Open

            if ( start && start[ 3 ] !== unit ) {
                // Trust units reported by jQuery.css
                unit = unit || start[ 3 ];

                // Make sure we update the tween properties later on
Severity: Critical
Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                            } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
                                diff = cache[1];
    
                            // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
                            } else {
    Severity: Critical
    Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                              } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
                                  diff = cache[1];
      
                              // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
                              } else {
      Severity: Critical
      Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                    if ( start && start[ 3 ] !== unit ) {
                        // Trust units reported by jQuery.css
                        unit = unit || start[ 3 ];
        
                        // Make sure we update the tween properties later on
        Severity: Critical
        Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

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

              def setUp(self):
                  self.user = User.objects.create_user('_test', '', password='test')
                  self.client.login(username='_test', password='test')
          Severity: Major
          Found in wouso/interface/api/tests.py and 1 other location - About 1 hr to fix
          wouso/interface/api/tests.py on lines 68..70

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

          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

              def setUp(self):
                  self.user = User.objects.create_user('_test', '', password='test')
                  self.client.login(username='_test', password='test')
          Severity: Major
          Found in wouso/interface/api/tests.py and 1 other location - About 1 hr to fix
          wouso/interface/api/tests.py on lines 29..31

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

          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

                      signals.addActivity.send(sender=None, user_from=self,
                                               user_to=self, message=signal_msg,
                                               arguments=dict(quest=self.current_quest.title),
                                               game=QuestGame.get_instance())
          Severity: Major
          Found in wouso/games/quest/models.py and 1 other location - About 1 hr to fix
          wouso/games/challenge/models.py on lines 87..91

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

          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

              def get_context_data(self, **kwargs):
                  context = super(StaticPagesView, self).get_context_data(**kwargs)
                  context['pages'] = StaticPage.objects.all()
                  return context
          Severity: Major
          Found in wouso/interface/cpanel/views.py and 2 other locations - About 1 hr to fix
          wouso/interface/apps/lesson/cpanel_views.py on lines 20..23
          wouso/interface/forum/cpanel_views.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 42.

          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

                  signals.addActivity.send(sender=None, user_from=self,
                                           user_to=self,
                                           message=signal_msg,
                                           arguments=dict(artifact=modifier.artifact.title),
                                           game=ChallengeGame.get_instance())
          Severity: Major
          Found in wouso/games/challenge/models.py and 1 other location - About 1 hr to fix
          wouso/games/quest/models.py on lines 91..94

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

          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

          @staff_required
          def workshop_start(request, workshop):
              workshop = get_object_or_404(Workshop, pk=workshop)
              workshop.start() # set start_at and active_until
              return redirect('ws_status', pk=workshop.pk)
          Severity: Major
          Found in wouso/games/workshop/cpanel.py and 1 other location - About 1 hr to fix
          wouso/games/workshop/cpanel.py on lines 376..380

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

          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

                  quest = Quest.objects.create(start=datetime.datetime.now(), end=datetime.datetime.now()+timedelta(days=1))
          Severity: Major
          Found in wouso/games/quest/tests.py and 1 other location - About 1 hr to fix
          wouso/games/quest/tests.py on lines 280..280

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

          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

          @staff_required
          def workshop_stop(request, workshop):
              workshop = get_object_or_404(Workshop, pk=workshop)
              workshop.stop() # set active_until
              return redirect('ws_status', pk=workshop.pk)
          Severity: Major
          Found in wouso/games/workshop/cpanel.py and 1 other location - About 1 hr to fix
          wouso/games/workshop/cpanel.py on lines 369..373

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

          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

                  quest = Quest.objects.create(start=datetime.datetime.now(), end=datetime.datetime.now()+timedelta(days=1))
          Severity: Major
          Found in wouso/games/quest/tests.py and 1 other location - About 1 hr to fix
          wouso/games/quest/tests.py on lines 269..269

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

          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

              def get_context_data(self, **kwargs):
                  context = super(LessonsView, self).get_context_data(**kwargs)
                  context['categories'] = LessonCategory.objects.all()
                  return context
          Severity: Major
          Found in wouso/interface/apps/lesson/cpanel_views.py and 2 other locations - About 1 hr to fix
          wouso/interface/cpanel/views.py on lines 1170..1173
          wouso/interface/forum/cpanel_views.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 42.

          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

              def get_context_data(self, **kwargs):
                  context = super(ForumIndexView, self).get_context_data(**kwargs)
                  context['categories'] = Category.objects.all()
                  return context
          Severity: Major
          Found in wouso/interface/forum/cpanel_views.py and 2 other locations - About 1 hr to fix
          wouso/interface/cpanel/views.py on lines 1170..1173
          wouso/interface/apps/lesson/cpanel_views.py on lines 20..23

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

          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 login_between_count(player, 3, 5) > 2:
                          if not player.magic.has_modifier('ach-night-owl'):
                              cls.earn_achievement(player, 'ach-night-owl')
          Severity: Major
          Found in wouso/interface/activity/achievements.py and 1 other location - About 1 hr to fix
          wouso/interface/activity/achievements.py on lines 349..351

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

          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 login_between_count(player, 6, 8) > 2:
                          if not player.magic.has_modifier('ach-early-bird'):
                              cls.earn_achievement(player, 'ach-early-bird')
          Severity: Major
          Found in wouso/interface/activity/achievements.py and 1 other location - About 1 hr to fix
          wouso/interface/activity/achievements.py on lines 346..348

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

          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 addClass has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              addClass: function( value ) {
                  var classes, elem, cur, clazz, j, finalValue,
                      i = 0,
                      len = this.length,
                      proceed = typeof value === "string" && value;
          Severity: Minor
          Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

            Function removeClass has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                removeClass: function( value ) {
                    var classes, elem, cur, clazz, j, finalValue,
                        i = 0,
                        len = this.length,
                        proceed = arguments.length === 0 || typeof value === "string" && value;
            Severity: Minor
            Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

              Function data has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  data: function( key, value ) {
                      var i, name, data,
                          elem = this[0],
                          attrs = elem && elem.attributes;
              
              
              Severity: Minor
              Found in wouso/resources/static/js/jquery.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language