rosedu/wouso

View on GitHub

Showing 2,707 of 2,707 total issues

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

(function( global, factory ) {

    if ( typeof module === "object" && typeof module.exports === "object" ) {
        // For CommonJS and CommonJS-like environments where a proper window is present,
        // execute the factory and get jQuery
Severity: Major
Found in wouso/resources/static/js/jquery.js and 1 other location - About 1 yr to fix
wouso/resources/static/js/jquery-1.11.1.min.js on lines 15..10308

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

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

(function( global, factory ) {

    if ( typeof module === "object" && typeof module.exports === "object" ) {
        // For CommonJS and CommonJS-like environments where a proper window is present,
        // execute the factory and get jQuery
Severity: Major
Found in wouso/resources/static/js/jquery-1.11.1.min.js and 1 other location - About 1 yr to fix
wouso/resources/static/js/jquery.js on lines 15..10308

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

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

File jquery.js has 6829 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v1.11.1
 * http://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in wouso/resources/static/js/jquery.js - About 2 wks to fix

    File jquery-1.11.1.min.js has 6829 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * jQuery JavaScript Library v1.11.1
     * http://jquery.com/
     *
     * Includes Sizzle.js
    Severity: Major
    Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 2 wks to fix

      Function Sizzle has 1347 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      (function( window ) {
      
      var i,
          support,
          Expr,
      Severity: Major
      Found in wouso/resources/static/js/jquery.js - About 6 days to fix

        Function Sizzle has 1347 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        (function( window ) {
        
        var i,
            support,
            Expr,
        Severity: Major
        Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 6 days to fix

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

          def try_using_cookie(username, first_name, last_name, email, password, cookie):
              (username, ret) = try_using_cookie_no_recurse(username, first_name, last_name, email, password, cookie)
          
              if ret == OP_SUCCESS:
                  return (username, True)
          Severity: Major
          Found in wouso/utils/add_users_force.py and 1 other location - About 4 days to fix
          wouso/utils/add_users_force_to_race.py on lines 79..128

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

          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

          def try_using_cookie(username, first_name, last_name, email, password, cookie):
              (username, ret) = try_using_cookie_no_recurse(username, first_name, last_name, email, password, cookie)
          
              if ret == OP_SUCCESS:
                  return (username, True)
          Severity: Major
          Found in wouso/utils/add_users_force_to_race.py and 1 other location - About 4 days to fix
          wouso/utils/add_users_force.py on lines 79..128

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

          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 autocomplete has a Cognitive Complexity of 198 (exceeds 5 allowed). Consider refactoring.
          Open

          jQuery.autocomplete = function(input, options) {
              // Create a link to self
              var me = this;
          
              // Create jQuery object for input element
          Severity: Minor
          Found in wouso/resources/static/js/jquery.autocomplete.js - About 4 days 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

          File bootstrap.js has 1387 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
           * Bootstrap v3.2.0 (http://getbootstrap.com)
           * Copyright 2011-2014 Twitter, Inc.
           * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
           */
          Severity: Major
          Found in wouso/resources/static/js/bootstrap.js - About 3 days to fix

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

                def clean(self):
                    data = self.cleaned_data
                    num = IntegerSetting.get('question_number_of_answers').get_value()
            
                    # Check the question text. If the normal text is missing, check for the
            Severity: Major
            Found in wouso/interface/cpanel/forms.py and 1 other location - About 3 days to fix
            wouso/interface/cpanel/forms.py on lines 51..77

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

            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 clean(self):
                    data = self.cleaned_data
                    num = IntegerSetting.get('question_number_of_answers').get_value()
            
                    # Check the question text. If the normal text is missing, check for the
            Severity: Major
            Found in wouso/interface/cpanel/forms.py and 1 other location - About 3 days to fix
            wouso/interface/cpanel/forms.py on lines 173..199

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

            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 try_using_truncate(username, first_name, last_name, email, password, cookie):
                (username, ret) = try_using_truncate_no_recurse(username, first_name, last_name, email, password)
            
                if ret == OP_SUCCESS:
                    return (username, True)
            Severity: Major
            Found in wouso/utils/add_users_force.py and 1 other location - About 2 days to fix
            wouso/utils/add_users_force_to_race.py on lines 41..76

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

            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 try_using_truncate(username, first_name, last_name, email, password, cookie):
                (username, ret) = try_using_truncate_no_recurse(username, first_name, last_name, email, password)
            
                if ret == OP_SUCCESS:
                    return (username, True)
            Severity: Major
            Found in wouso/utils/add_users_force_to_race.py and 1 other location - About 2 days to fix
            wouso/utils/add_users_force.py on lines 41..76

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

            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

            File views.py has 1025 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import datetime
            from django import forms
            from django.conf import settings
            from django.contrib import messages
            from django.contrib.auth import models as auth
            Severity: Major
            Found in wouso/interface/cpanel/views.py - About 2 days to fix

              Function activity_handler has a Cognitive Complexity of 122 (exceeds 5 allowed). Consider refactoring.
              Open

                  def activity_handler(cls, sender, **kwargs):
                      action = kwargs.get('action', None)
                      player = kwargs.get('user_from', None)
              
                      if player:
              Severity: Minor
              Found in wouso/interface/activity/achievements.py - About 2 days to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function ajaxSubmit has 492 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              $.fn.ajaxSubmit = function(options) {
                  /*jshint scripturl:true */
              
                  // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
                  if (!this.length) {
              Severity: Major
              Found in wouso/resources/static/js/jquery.form.js - About 2 days to fix

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

                    def test_charge(self):
                        """
                         Test for Charge spell
                        """
                        initial_points = 100
                Severity: Major
                Found in wouso/core/magic/tests.py and 2 other locations - About 2 days to fix
                wouso/core/magic/tests.py on lines 294..323
                wouso/core/magic/tests.py on lines 361..389

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

                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 test_weakness(self):
                        """
                         Test for Weakness spell
                        """
                        initial_points = 100
                Severity: Major
                Found in wouso/core/magic/tests.py and 2 other locations - About 2 days to fix
                wouso/core/magic/tests.py on lines 294..323
                wouso/core/magic/tests.py on lines 391..418

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

                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 test_frenzy_win(self):
                        """
                         If user wins while affected by frenzy he should win frenzy.percents more points
                        """
                        initial_points = 100
                Severity: Major
                Found in wouso/core/magic/tests.py and 2 other locations - About 2 days to fix
                wouso/core/magic/tests.py on lines 361..389
                wouso/core/magic/tests.py on lines 391..418

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

                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