rosedu/wouso

View on GitHub

Showing 551 of 2,707 total issues

Function get_specialquest_user_button has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def get_specialquest_user_button(kls, request, player):
        specialquest_button = dict(MATE=False, OTHER=False,
                                   ALREADY_INVITED=False, INIVTE=False)
        if request.user.get_profile().id != player.id:
            squser = request.user.get_profile().get_extension(SpecialQuestUser)
Severity: Minor
Found in wouso/games/specialquest/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 infraction_recheck has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def infraction_recheck(request):
    """ Rerun an infraction check on the current challenge history

        The view should allow for other infraction additions. """
    try:
Severity: Minor
Found in wouso/interface/cpanel/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 15 (exceeds 5 allowed). Consider refactoring.
Open

def create(request, to=None, reply_to=None):
    if to is not None:
        to = get_object_or_404(Player, pk=to)
    if reply_to is not None:
        reply_to = get_object_or_404(Message, pk=reply_to)
Severity: Minor
Found in wouso/interface/apps/messaging/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 select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

select = Sizzle.select = function( selector, context, results, seed ) {
    var i, tokens, token, type, find,
        compiled = typeof selector === "function" && selector,
        match = !seed && tokenize( (selector = compiled.selector || selector) );

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

    Function internalData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
        if ( !jQuery.acceptData( elem ) ) {
            return;
        }
    
    
    Severity: Minor
    Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

      Function select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      select = Sizzle.select = function( selector, context, results, seed ) {
          var i, tokens, token, type, find,
              compiled = typeof selector === "function" && selector,
              match = !seed && tokenize( (selector = compiled.selector || selector) );
      
      
      Severity: Minor
      Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

        Function internalData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
            if ( !jQuery.acceptData( elem ) ) {
                return;
            }
        
        
        Severity: Minor
        Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

          Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
              var matched, match, tokens, type,
                  soFar, groups, preFilters,
                  cached = tokenCache[ selector + " " ];
          
          
          Severity: Minor
          Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

            Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                var matched, match, tokens, type,
                    soFar, groups, preFilters,
                    cached = tokenCache[ selector + " " ];
            
            
            Severity: Minor
            Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

              Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function matcherFromTokens( tokens ) {
                  var checkContext, matcher, j,
                      len = tokens.length,
                      leadingRelative = Expr.relative[ tokens[0].type ],
                      implicitRelative = leadingRelative || Expr.relative[" "],
              Severity: Minor
              Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

                Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function matcherFromTokens( tokens ) {
                    var checkContext, matcher, j,
                        len = tokens.length,
                        leadingRelative = Expr.relative[ tokens[0].type ],
                        implicitRelative = leadingRelative || Expr.relative[" "],
                Severity: Minor
                Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                  Function setup_create has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def setup_create(request):
                      user = request.user.get_profile().get_extension(SpecialQuestUser)
                      group = user.group
                      error = ''
                      if group is not None:
                  Severity: Minor
                  Found in wouso/games/specialquest/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 management_task has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def management_task(cls, now=None, stdout=sys.stdout):
                          now = now if now is not None else datetime.now()
                          today = now.date()
                  
                          # Global ladder
                  Severity: Minor
                  Found in wouso/interface/top/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 question_switch has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def question_switch(request, id):
                      """ Accept a proposed question """
                      question = get_object_or_404(Question, pk=id)
                  
                      # qproposal - endorse part
                  Severity: Minor
                  Found in wouso/interface/cpanel/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 propose has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def propose(request):
                  
                      MAX_ANSWERS = 6
                  
                      if request.method == 'POST':
                  Severity: Minor
                  Found in wouso/interface/apps/qproposal/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 handle has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def handle(self, *args, **options):
                          save_load_labels = ['magic', 'scoring.coin', 'scoring.formula', 'config', 'pages', 'user.race', 'user.playergroup']
                          reset_labels = ['magic', 'scoring', 'config', 'pages']
                          if options['check_setup']:
                              ok = True
                  Severity: Minor
                  Found in wouso/core/game/management/commands/wousoctl.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 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def save(self, commit=True):
                          new = self.instance.pk is None
                          question = super(QuestionForm, self).save(commit=commit)
                          if new:
                              for i in range(self.DEFAULT_ANSWERS):
                  Severity: Minor
                  Found in wouso/games/specialchallenge/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

                  Consider simplifying this complex logical expression.
                  Open

                              if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                  ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                                  ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                  !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
                  
                  
                  Severity: Critical
                  Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                                if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                    ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                                    ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                    !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
                    
                    
                    Severity: Critical
                    Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                      Function val has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          val: function( value ) {
                              var hooks, ret, isFunction,
                                  elem = this[0];
                      
                              if ( !arguments.length ) {
                      Severity: Minor
                      Found in wouso/resources/static/js/jquery.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language