rosedu/wouso

View on GitHub

Showing 551 of 2,707 total issues

Function when has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    when: function( subordinate /* , ..., subordinateN */ ) {
        var i = 0,
            resolveValues = slice.call( arguments ),
            length = resolveValues.length,

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

    Function extra_stats has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def extra_stats(request):
        """
        Generate extra statistics, dump them as JSON
    
        * Numărul de jucători care au accesat în 95% din zile site-ul
    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 bonus has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def bonus(request, player_id):
        player = get_object_or_404(Player, pk=player_id)
    
        if request.method == 'POST':
            form = BonusForm(request.POST)
    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 launch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def launch(request, to_id):
        lock = challengeLock.lock()
        logging.info("Locked.")
    
        flush_transaction()
    Severity: Minor
    Found in wouso/games/challenge/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 review has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def review(request, workshop):
        player = request.user.get_profile()
        workshop = get_object_or_404(Workshop, pk=workshop)
    
        assessment = workshop.get_assessment(player)
    Severity: Minor
    Found in wouso/games/workshop/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 setup_scoring has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def setup_scoring():
    
        """ Prepare database for Scoring """
        for cc in CORE_POINTS:
            if not Coin.get(cc):
    Severity: Minor
    Found in wouso/core/scoring/sm.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 dispatch has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        dispatch: function( event ) {
    
            // Make a writable jQuery.Event from the native event object
            event = jQuery.event.fix( event );
    
    
    Severity: Minor
    Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

      Function clone has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          clone: function( elem, dataAndEvents, deepDataAndEvents ) {
              var destElements, node, clone, i, srcElements,
                  inPage = jQuery.contains( elem.ownerDocument, elem );
      
              if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
      Severity: Minor
      Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

        Function access has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
            var i = 0,
                length = elems.length,
                bulk = key == null;
        
        
        Severity: Minor
        Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

          Function showHide has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function showHide( elements, show ) {
              var display, elem, hidden,
                  values = [],
                  index = 0,
                  length = elements.length;
          Severity: Minor
          Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

            Function dispatch has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                dispatch: function( event ) {
            
                    // Make a writable jQuery.Event from the native event object
                    event = jQuery.event.fix( event );
            
            
            Severity: Minor
            Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

              Function add has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      add: function(element, interval, label, fn, times, belay) {
                          var counter = 0;
                          
                          if (jQuery.isFunction(label)) {
                              if (!times) 
              Severity: Minor
              Found in wouso/resources/static/js/jquery.timers.js - About 1 hr to fix

                Function clone has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    clone: function( elem, dataAndEvents, deepDataAndEvents ) {
                        var destElements, node, clone, i, srcElements,
                            inPage = jQuery.contains( elem.ownerDocument, elem );
                
                        if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
                Severity: Minor
                Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                  Function showHide has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function showHide( elements, show ) {
                      var display, elem, hidden,
                          values = [],
                          index = 0,
                          length = elements.length;
                  Severity: Minor
                  Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                    Function access has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
                        var i = 0,
                            length = elems.length,
                            bulk = key == null;
                    
                    
                    Severity: Minor
                    Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                      Function style has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          style: function( elem, name, value, extra ) {
                              // Don't set styles on text and comment nodes
                              if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                                  return;
                              }
                      Severity: Minor
                      Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

                        Function show has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          Modal.prototype.show = function (_relatedTarget) {
                            var that = this
                            var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
                        
                            this.$element.trigger(e)
                        Severity: Minor
                        Found in wouso/resources/static/js/bootstrap.js - About 1 hr to fix

                          Function cleanData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              cleanData: function( elems, /* internal */ acceptData ) {
                                  var elem, type, id, data,
                                      i = 0,
                                      internalKey = jQuery.expando,
                                      cache = jQuery.cache,
                          Severity: Minor
                          Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

                            Function fieldValue has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            $.fieldValue = function(el, successful) {
                                var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
                                if (successful === undefined) {
                                    successful = true;
                                }
                            Severity: Minor
                            Found in wouso/resources/static/js/jquery.form.js - About 1 hr to fix

                              Function setOffset has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  setOffset: function( elem, options, i ) {
                                      var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
                                          position = jQuery.css( elem, "position" ),
                                          curElem = jQuery( elem ),
                                          props = {};
                              Severity: Minor
                              Found in wouso/resources/static/js/jquery.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language