etnbrd/flx-compiler

View on GitHub

Showing 623 of 1,229 total issues

Avoid deeply nested control flow statements.
Open

                                    if ( !status && s.isLocal && !s.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 test-set/gifsockets-server-master/public/js/jquery.js - About 45 mins to fix

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

    function extractUp(tree, id) {
    
      var _n = {};
      var __n = {};
      var _d = {};
    Severity: Minor
    Found in prototypes/blender/lib/extract.js - 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 (_handlers[event][j].handler !== handler)
                  a.push(_handlers[event][j]);
    Severity: Major
    Found in prototypes/express/src/console/sigma/src/conrad.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                if (typeof v1[i] === 'function')
                  _addJob(i, __extend({
                    job: v1[i]
                  }, v2));
                else
      Severity: Major
      Found in prototypes/express/src/console/sigma/src/conrad.js - About 45 mins to fix

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

        function post(msg) {
        
          function postMsg(type, body, ctx) {
              var msg = MSG[type].flx.call(ctx, body);
        
        
        Severity: Minor
        Found in prototypes/express/src/old/fluxion2.js - 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 (_parameters.history) {
                    job.status = 'done';
                    _doneJobs.push(job);
                  }
        Severity: Major
        Found in prototypes/express/src/console/sigma/src/conrad.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      if (this._handlers[event][j].handler !== handler)
                        a.push(this._handlers[event][j]);

            Avoid deeply nested control flow statements.
            Open

                          if (n.size > selected[j].size) {
                            selected.splice(j, 0, n);
                            inserted = true;
                            break;
                          }
            Severity: Major
            Found in prototypes/express/src/console/sigma/src/misc/sigma.misc.bindEvents.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            for (k3 in this.allNeighborsIndex[k1][k2])
                              if (!localEdgesIndex[k3]) {
                                localEdgesIndex[k3] = true;
                                graph.edges.push(this.edgesIndex[k3]);
                              }

                Avoid deeply nested control flow statements.
                Open

                          if (typeof job.end === 'function')
                            job.end();
                Severity: Major
                Found in prototypes/express/src/console/sigma/src/conrad.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            for (var k = 0; k < graphParts.length; k++) {
                              for (var m = 0; m < graphParts[i].names.length; m++) { var name = graphParts[i].names[m];
                                if (name === graphParts[k].to) {
                                  console.log(name + " === " + graphParts[k].to)
                                  graphParts[k].index = m;
                  Severity: Major
                  Found in prototypes/recast/main.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                    for (i2 = 0; i2 < i1; i2++)
                                      if ((n2 = nodes[i2]).fa2)
                                        Repulsion.apply_nn(n1, n2);

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

                        enter: function(n, c) {
                      
                          // TODO this is bad design
                          var _c = {id: ""};
                          map(n.callee, _getId(_c));
                      Severity: Minor
                      Found in prototypes/shreder/lib/transform.js - 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 (this.settings('verbose'))
                                      console.log(
                                        'Warning: The renderer "' +
                                          a[i].id +
                                          '" crashed on ".render()"'
                      Severity: Major
                      Found in prototypes/express/src/console/sigma/src/sigma.core.js - About 45 mins to fix

                        Function ASCIIgraph has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function ASCIIgraph(name, mean, median, min, max, length) {
                        Severity: Minor
                        Found in prototypes/fluxions/bench/distribution/index.js - About 45 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {
                                    halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {
                                      x: x0,
                                      y: abs(x2 - x0) < ε ? y2 : y1
                                    } : abs(y3 - y1) < ε && x1 - x3 > ε ? {
                          Severity: Major
                          Found in lib/graph-printer/old/bower_components/d3/d3.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if ( s.crossDomain == null ) {
                                        parts = rurl.exec( s.url.toLowerCase() );
                                        s.crossDomain = !!( parts &&
                                            ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
                                                ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
                            Severity: Major
                            Found in test-set/gifsockets-server-master/public/js/jquery.js - About 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                              if ( !jQuery.support.opacity ) {
                                  jQuery.cssHooks.opacity = {
                                      get: function( elem, computed ) {
                                          // IE uses filters for opacity
                                          return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
                              Severity: Major
                              Found in test-set/gifsockets-server-master/public/js/jquery.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if ( matcher[ expando ] ) {
                                                // Find the next relative operator (if any) for proper handling
                                                j = ++i;
                                                for ( ; j < len; j++ ) {
                                                    if ( Expr.relative[ tokens[j].type ] ) {
                                Severity: Major
                                Found in test-set/gifsockets-server-master/public/js/jquery.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
                                          return;
                                      }
                                  Severity: Major
                                  Found in test-set/gifsockets-server-master/public/js/jquery.js - About 40 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language