rosedu/wouso

View on GitHub

Showing 2,707 of 2,707 total issues

Function add_user_helper has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def add_user_helper(username, first_name, last_name, email, password):
Severity: Minor
Found in wouso/utils/add_users_force_to_race.py - About 35 mins to fix

    Function try_using_index_no_recurse has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def try_using_index_no_recurse(username, first_name, last_name, email, password):
    Severity: Minor
    Found in wouso/utils/add_users_force.py - About 35 mins to fix

      Function try_using_truncate_no_recurse has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def try_using_truncate_no_recurse(username, first_name, last_name, email, password):
      Severity: Minor
      Found in wouso/utils/add_users_force.py - About 35 mins to fix

        Function delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def delete(cls, game, user_from, user_to, message, arguments):
        Severity: Minor
        Found in wouso/interface/activity/models.py - About 35 mins to fix

          Function try_using_index_no_recurse has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def try_using_index_no_recurse(username, first_name, last_name, email, password):
          Severity: Minor
          Found in wouso/utils/add_users_force_to_race.py - About 35 mins to fix

            Function try_using_truncate_no_recurse has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def try_using_truncate_no_recurse(username, first_name, last_name, email, password):
            Severity: Minor
            Found in wouso/utils/add_users_force_to_race.py - About 35 mins to fix

              Function timer has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def timer(user, game, formula, default=300, **params):
              Severity: Minor
              Found in wouso/core/scoring/sm.py - About 35 mins to fix

                Function history_for has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def history_for(user, game, external_id=None, formula=None, coin=None):
                Severity: Minor
                Found in wouso/core/scoring/sm.py - About 35 mins to fix

                  Function create_workshop has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def create_workshop(cls, semigroup, date, title, question_count=4):
                  Severity: Minor
                  Found in wouso/games/workshop/models.py - About 35 mins to fix

                    Function unset has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

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

                      Function homepage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def homepage(request, page=u'1'):
                          """ First page shown """
                          if request.user.is_anonymous():
                              return anonymous_homepage(request)
                      
                      
                      Severity: Minor
                      Found in wouso/interface/views.py - About 35 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

                      Function bazaar_buy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def bazaar_buy(request, spell):
                          spell = get_object_or_404(Spell, pk=spell)
                      
                          player = request.user.get_profile()
                          error, message = '',''
                      Severity: Minor
                      Found in wouso/interface/apps/magic/views.py - About 35 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

                      Function export_to_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def export_to_file(file):
                          from wouso.core.qpool.models import Question, Answer
                      
                          with codecs.open(file, 'w', 'utf-8') as f:
                      
                      
                      Severity: Minor
                      Found in wouso/utils/export_questions.py - About 35 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

                      Function read has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def read(self, request, group_id=None, race_id=None):
                              if race_id:
                                  try:
                                      race = Race.objects.get(pk=race_id)
                                  except Race.DoesNotExist:
                      Severity: Minor
                      Found in wouso/interface/api/handlers.py - About 35 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

                      Function create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def create(self, request, player_id):
                              player = request.user.get_profile()
                              try:
                                  destination = Player.objects.get(pk=player_id)
                              except Player.DoesNotExist:
                      Severity: Minor
                      Found in wouso/interface/api/handlers.py - About 35 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

                      Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def __init__(self, data=None, instance=None):
                              super(EditLessonForm, self).__init__(data)
                      
                              self.fields['name'] = forms.CharField(max_length=100, required=True, initial=instance.name)
                              categories = [(c.name, c.name.capitalize()) for c in LessonCategory.objects.all()]
                      Severity: Minor
                      Found in wouso/interface/apps/lesson/forms.py - About 35 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

                      Function setup_invite has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def setup_invite(request, user_id):
                          user = request.user.get_profile().get_extension(SpecialQuestUser)
                          to_user = get_object_or_404(Player, pk=user_id)
                          to_user = to_user.get_extension(SpecialQuestUser)
                          group = user.group
                      Severity: Minor
                      Found in wouso/games/specialquest/views.py - About 35 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

                      Function clean has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def clean(self):
                              cleaned_data = self.cleaned_data
                              answer_type = cleaned_data.get('answer_type')
                              nr = 0
                              for i in range(self.nr_ans):
                      Severity: Minor
                      Found in wouso/interface/apps/qproposal/forms.py - About 35 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

                      Function edit_question has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def edit_question(request, id):
                          question = get_object_or_404(Question, pk=id)
                          categories = [(c.name.capitalize(), c.name) for c in Category.objects.all()]
                          answers_range = [str(i) for i in range(1, len(question.answers_all) + 1)]
                      
                      
                      Severity: Minor
                      Found in wouso/interface/cpanel/views.py - About 35 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

                      Function stafftoggle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def stafftoggle(request, id):
                          profile = get_object_or_404(Player, pk=id)
                      
                          if profile != request.user.get_profile():
                              staff_group, new = auth.Group.objects.get_or_create(name='Staff')
                      Severity: Minor
                      Found in wouso/interface/cpanel/views.py - About 35 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

                      Severity
                      Category
                      Status
                      Source
                      Language