etnbrd/flx-compiler

View on GitHub

Showing 1,229 of 1,229 total issues

Avoid deeply nested control flow statements.
Open

                    if (opts[methodName]) {
                        throw new Error(methodName + ' method can be called just once per query');
                    } else {
                        opts[methodName] = args; //we shall add it to the options, this object will be used when reiterating on LQ
                    }
Severity: Major
Found in test-set/Moonridge-master/query-builder.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

            if (tree.dep[j].to === tree.ids[i].id) {
              // console.log("   + ", tree.dep[j]);
              _up.push(j);
            }
    Severity: Major
    Found in prototypes/blender.old/lib/reduction.js - About 45 mins to fix

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

      function redTree() {
        var _ids = [];
      
        for (var j = 0; j < this.dep.length; j++) {
          var index = undefined;
      Severity: Minor
      Found in prototypes/blender.old/lib/graphviz.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 ( !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

                              Similar blocks of code found in 4 locations. Consider refactoring.
                              Open

                                        if (i === edges.length)
                                          self.state = {
                                            step: 4,
                                            index: 0
                                          };
                              prototypes/express/src/console/sigma/plugins/sigma.layout.forceAtlas2/sigma.layout.forceAtlas2.js on lines 132..138
                              prototypes/express/src/console/sigma/plugins/sigma.layout.forceAtlas2/sigma.layout.forceAtlas2.js on lines 148..154
                              prototypes/express/src/console/sigma/plugins/sigma.layout.forceAtlas2/sigma.layout.forceAtlas2.js on lines 180..186

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 50.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 3 locations. Consider refactoring.
                              Open

                                      return tree.nodes.some(function(node) {
                                        return dep.id === node.id || dep.to === node.to
                                      })
                              Severity: Major
                              Found in prototypes/blender/lib/resolution.js and 2 other locations - About 45 mins to fix
                              prototypes/blender.old/index.js on lines 245..247
                              prototypes/blender/lib/extraction.js on lines 89..91

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 50.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Severity
                              Category
                              Status
                              Source
                              Language