rosedu/wouso

View on GitHub

Showing 551 of 2,707 total issues

Avoid deeply nested control flow statements.
Open

                        if ( matches[ sel ] ) {
                            matches.push( handleObj );
                        }
Severity: Major
Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    } else if ( copy !== undefined ) {
                        target[ name ] = copy;
                    }
    Severity: Major
    Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              for ( var fn in timers[label] ) {
                                  window.clearInterval(timers[label][fn]);
                                  delete timers[label][fn];
                              }
      Severity: Major
      Found in wouso/resources/static/js/jquery.timers.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if ( elem && elem.parentNode ) {
                                // Handle the case where IE, Opera, and Webkit return items
                                // by name instead of ID
                                if ( elem.id === m ) {
                                    results.push( elem );
        Severity: Major
        Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for ( match in context ) {
                                      // Properties of context are called as methods if possible
                                      if ( jQuery.isFunction( this[ match ] ) ) {
                                          this[ match ]( context[ match ] );
          
          
          Severity: Major
          Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                            if ( xhr.readyState !== 4 ) {
                                                xhr.abort();
                                            }
            Severity: Major
            Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
                                          cur = cur.replace( " " + clazz + " ", " " );
                                      }
              Severity: Major
              Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    for ( conv2 in converters ) {
                
                                        // If conv2 outputs current
                                        tmp = conv2.split( " " );
                                        if ( tmp[ 1 ] === current ) {
                Severity: Major
                Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                  if ( typeof xhr.responseText === "string" ) {
                                                      responses.text = xhr.responseText;
                                                  }
                  Severity: Major
                  Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if ( matches[ sel ] === undefined ) {
                                                matches[ sel ] = handleObj.needsContext ?
                                                    jQuery( sel, this ).index( cur ) >= 0 :
                                                    jQuery.find( sel, this, null, [ cur ] ).length;
                                            }
                    Severity: Major
                    Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if ( conv && s[ "throws" ] ) {
                                              response = conv( response );
                                          } else {
                                              try {
                                                  response = conv( response );
                      Severity: Major
                      Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                        !function (a, b) { "use strict"; function c() { return b } "function" == typeof define && define.amd ? define("tinysort", c) : a.tinysort = b }(this, function () { "use strict"; function a(a, f) { function j() { 0 === arguments.length ? s({}) : d(arguments, function (a) { s(c(a) ? { selector: a } : a) }), p = D.length } function s(a) { var b = !!a.selector, c = b && ":" === a.selector[0], d = e(a || {}, r); D.push(e({ hasSelector: b, hasAttr: !(d.attr === i || "" === d.attr), hasData: d.data !== i, hasFilter: c, sortReturnNumber: "asc" === d.order ? 1 : -1 }, d)) } function t() { d(a, function (a, b) { y ? y !== a.parentNode && (E = !1) : y = a.parentNode; var c = D[0], d = c.hasFilter, e = c.selector, f = !e || d && a.matchesSelector(e) || e && a.querySelector(e), g = f ? B : C, h = { elm: a, pos: b, posn: g.length }; A.push(h), g.push(h) }), x = B.slice(0) } function u() { B.sort(v) } function v(a, e) { var f = 0; for (0 !== q && (q = 0) ; 0 === f && p > q;) { var i = D[q], j = i.ignoreDashes ? n : m; if (d(o, function (a) { var b = a.prepare; b && b(i) }), i.sortFunction) f = i.sortFunction(a, e); else if ("rand" == i.order) f = Math.random() < .5 ? 1 : -1; else { var k = h, r = b(a, i), s = b(e, i), t = "" === r || r === g, u = "" === s || s === g; if (r === s) f = 0; else if (i.emptyEnd && (t || u)) f = t && u ? 0 : t ? 1 : -1; else { if (!i.forceStrings) { var v = c(r) ? r && r.match(j) : h, w = c(s) ? s && s.match(j) : h; if (v && w) { var x = r.substr(0, r.length - v[0].length), y = s.substr(0, s.length - w[0].length); x == y && (k = !h, r = l(v[0]), s = l(w[0])) } } f = r === g || s === g ? 0 : s > r ? -1 : r > s ? 1 : 0 } } d(o, function (a) { var b = a.sort; b && (f = b(i, k, r, s, f)) }), f *= i.sortReturnNumber, 0 === f && q++ } return 0 === f && (f = a.pos > e.pos ? 1 : -1), f } function w() { var a = B.length === A.length; E && a ? F ? B.forEach(function (a, b) { a.elm.style.order = b }) : (B.forEach(function (a) { z.appendChild(a.elm) }), y.appendChild(z)) : (B.forEach(function (a) { var b = a.elm, c = k.createElement("div"); a.ghost = c, b.parentNode.insertBefore(c, b) }), B.forEach(function (a, b) { var c = x[b].ghost; c.parentNode.insertBefore(a.elm, c), c.parentNode.removeChild(c) })) } c(a) && (a = k.querySelectorAll(a)), 0 === a.length && console.warn("No elements to sort"); var x, y, z = k.createDocumentFragment(), A = [], B = [], C = [], D = [], E = !0, F = a.length && (f === g || f.useFlex !== !1) && -1 !== getComputedStyle(a[0].parentNode, null).display.indexOf("flex"); return j.apply(i, Array.prototype.slice.call(arguments, 1)), t(), u(), w(), B.map(function (a) { return a.elm }) } function b(a, b) { var d, e = a.elm; return b.selector && (b.hasFilter ? e.matchesSelector(b.selector) || (e = i) : e = e.querySelector(b.selector)), b.hasAttr ? d = e.getAttribute(b.attr) : b.useVal ? d = e.value || e.getAttribute("value") : b.hasData ? d = e.getAttribute("data-" + b.data) : e && (d = e.textContent), c(d) && (b.cases || (d = d.toLowerCase()), d = d.replace(/\s+/g, " ")), d } function c(a) { return "string" == typeof a } function d(a, b) { for (var c, d = a.length, e = d; e--;) c = d - e - 1, b(a[c], c) } function e(a, b, c) { for (var d in b) (c || a[d] === g) && (a[d] = b[d]); return a } function f(a, b, c) { o.push({ prepare: a, sort: b, sortBy: c }) } var g, h = !1, i = null, j = window, k = j.document, l = parseFloat, m = /(-?\d+\.?\d*)\s*$/g, n = /(\d+\.?\d*)\s*$/g, o = [], p = 0, q = 0, r = { selector: i, order: "asc", attr: i, data: i, useVal: h, place: "start", returns: h, cases: h, forceStrings: h, ignoreDashes: h, sortFunction: i, useFlex: h, emptyEnd: h }; return j.Element && function (a) { a.matchesSelector = a.matchesSelector || a.mozMatchesSelector || a.msMatchesSelector || a.oMatchesSelector || a.webkitMatchesSelector || function (a) { for (var b = this, c = (b.parentNode || b.document).querySelectorAll(a), d = -1; c[++d] && c[d] != b;); return !!c[d] } }(Element.prototype), e(f, { loop: d }), e(a, { plugin: f, defaults: r }) }());
                        Severity: Major
                        Found in wouso/resources/static/js/bootstrap-sortable.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                              if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
                                                                  return false;
                                                              }
                          Severity: Major
                          Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if ( !(unmatched[i] || setMatched[i]) ) {
                                                            setMatched[i] = pop.call( results );
                                                        }
                            Severity: Major
                            Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      while ( j-- ) {
                                                          if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
                                                              elem.removeChild( tbody );
                                                          }
                                                      }
                              Severity: Major
                              Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if ( copyIsArray ) {
                                                        copyIsArray = false;
                                                        clone = src && jQuery.isArray(src) ? src : [];
                                
                                                    } else {
                                Severity: Major
                                Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if ( Expr.relative[ tokens[j].type ] ) {
                                                          break;
                                                      }
                                  Severity: Major
                                  Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                    if ( !status && options.isLocal && !options.crossDomain ) {
                                                                        status = responses.text ? 200 : 404;
                                                                    // IE - #1450: sometimes returns 1223 when it should be 204
                                                                    } else if ( status === 1223 ) {
                                                                        status = 204;
                                    Severity: Major
                                    Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 45 mins to fix

                                      Function process_request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          def process_request(self, request):
                                              if not hasattr(request, 'user') or not hasattr(request, 'session'):
                                                  return
                                              real_user = request.user
                                              impersonated_id = self.get_impersonation(request)
                                      Severity: Minor
                                      Found in wouso/middleware/impersonation.py - About 45 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

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if karma_points == 0:
                                                              continue
                                      
                                                          # Compute formula and calculate amount of bonus given
                                                          amount = eval(formula.expression.format(**{'karma_points': karma_points}).split('=')[1])
                                      Severity: Major
                                      Found in wouso/interface/cpanel/views.py - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language