rosedu/wouso

View on GitHub

Showing 551 of 2,707 total issues

Function fix has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    fix: function( event ) {
        if ( event[ jQuery.expando ] ) {
            return event;
        }

Severity: Minor
Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

    Function finish has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        finish: function( type ) {
            if ( type !== false ) {
                type = type || "fx";
            }
            return this.each(function() {
    Severity: Minor
    Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

      Function process_response has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def process_response(self, request, response):
              """ Handle redirects
              """
              if not hasattr(request, 'user') or not hasattr(request, 'session'):
                  return response
      Severity: Minor
      Found in wouso/middleware/impersonation.py - About 1 hr 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 authenticate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def authenticate(self, username=None, password=None):
              if password == "" or password is None or username is None:
                  raise Exception('Invalid user or password')
      
              username, password = username.strip(), password.strip()
      Severity: Minor
      Found in wouso/middleware/ldap_connection.py - About 1 hr 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 main has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def main():
          if len(sys.argv) != 5:
              print >>sys.stderr, 'Usage: add_questions.py <file> <category> <proposed-by> <endorsed_by>'
              sys.exit(1)
      
      
      Severity: Minor
      Found in wouso/utils/add_questions.py - About 1 hr 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 stats has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def stats(request):
      
          data = {}
      
          # now
      Severity: Minor
      Found in wouso/interface/apps/statistics/views.py - About 1 hr 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 searchone has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def searchone(request):
          """ Get one user, based on his/her name """
          logger.debug('Initiating search one')
          form = SearchOneForm(request.GET)
          if form.is_valid():
      Severity: Minor
      Found in wouso/interface/views.py - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def create(self, request):
              attrs = self.flatten_dict(request.POST)
              sender = request.user.get_profile()
      
              try:
      Severity: Minor
      Found in wouso/interface/api/handlers.py - About 1 hr 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 main has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def main():
          if len(sys.argv) != 2:
              print 'Usage: python add_users.py <file.csv>'
              print " CSV columns: username, first name, last name, email, password, cookie, race"
              sys.exit(1)
      Severity: Minor
      Found in wouso/utils/add_users_force_to_race.py - About 1 hr 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 main has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def main():
      
          if len(sys.argv) != 2:
              print 'Usage: import_users.py <file.csv>'
              print " CSV columns: last name, first name, uid, group"
      Severity: Minor
      Found in wouso/utils/import_users.py - About 1 hr 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 save has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def save(self):
              data = self.cleaned_data
      
              self.instance.category = get_object_or_404(Category, name=data['category'])
      
      
      Severity: Minor
      Found in wouso/interface/cpanel/forms.py - About 1 hr 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 play_round has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def play_round(cls, lost_count, round_number):
              """
              Create new challenges.
              """
              if lost_count == 0:
      Severity: Minor
      Found in wouso/games/grandchallenge/models.py - About 1 hr 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 get_or_create_assessment has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_or_create_assessment(self, player):
              """ Return existing or new assessment for player
              """
              try:
                  assessment, is_new = Assessment.objects.get_or_create(player=player, workshop=self)
      Severity: Minor
      Found in wouso/games/workshop/models.py - About 1 hr 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 index has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def index(request):
          quest = QuestGame.get_current()
      
          if quest == None:
              return render_to_response('quest/none.html', context_instance=RequestContext(request))
      Severity: Minor
      Found in wouso/games/quest/views.py - About 1 hr 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 user_can_interact_with has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def user_can_interact_with(self, player_from, player_to, game=None):
              if game is not None:
                  game = str(game.__name__)
      
              if game == 'ChallengeGame':
      Severity: Minor
      Found in wouso/core/god/god.py - About 1 hr 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 propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function propFilter( props, specialEasing ) {
          var index, name, easing, value, hooks;
      
          // camelCase, specialEasing and expand cssHook pass
          for ( index in props ) {
      Severity: Minor
      Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

        Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                setup: function() {
        
                    if ( rformElems.test( this.nodeName ) ) {
                        // IE doesn't fire change on a check/radio until blur; trigger it on click
                        // after a propertychange. Eat the blur-change in special.change.handle.
        Severity: Minor
        Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

          Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  setup: function() {
          
                      if ( rformElems.test( this.nodeName ) ) {
                          // IE doesn't fire change on a check/radio until blur; trigger it on click
                          // after a propertychange. Eat the blur-change in special.change.handle.
          Severity: Minor
          Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

            Function activate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              Tab.prototype.activate = function (element, container, callback) {
                var $active    = container.find('> .active')
                var transition = callback
                  && $.support.transition
                  && $active.hasClass('fade')
            Severity: Minor
            Found in wouso/resources/static/js/bootstrap.js - About 1 hr to fix

              Function propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function propFilter( props, specialEasing ) {
                  var index, name, easing, value, hooks;
              
                  // camelCase, specialEasing and expand cssHook pass
                  for ( index in props ) {
              Severity: Minor
              Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language