etnbrd/flx-compiler

View on GitHub

Showing 1,229 of 1,229 total issues

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

  next : function(arg, source) {
    if (!MSG[source])
      MSG[source] = {arg: [arg], flx: []}
    else
      MSG[source].arg.push(arg);
Severity: Major
Found in prototypes/express/src/old/fluxion.js and 1 other location - About 1 hr to fix
prototypes/express/src/old/fluxion.js on lines 69..74

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 67.

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

Function graph has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function graph(ctx, code) {
  var tagsByLine = [], nbLines;
  code = String(code).split('\n');
  nbLines = code.length;

Severity: Minor
Found in lib/graph-inspector-printer/graph.js - 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 value has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    value: function(predicate) {
      if (this == null) {
        throw new TypeError('Array.prototype.find called on null or undefined');
      }
      if (typeof predicate !== 'function') {
Severity: Minor
Found in prototypes/blender.old/index.old.js - 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 value has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    value: function(predicate) {
      if (this == null) {
        throw new TypeError('Array.prototype.find called on null or undefined');
      }
      if (typeof predicate !== 'function') {
Severity: Minor
Found in prototypes/blender.old/index.js - 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 value has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    value: function(predicate) {
      if (this == null) {
        throw new TypeError('Array.prototype.find called on null or undefined');
      }
      if (typeof predicate !== 'function') {
Severity: Minor
Found in prototypes/blender.old/lib/tools.js - 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 post has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function post(msg) {

    function postMsg(type, body) {
      for (var i = 0; i < MSG[type].flx.length; i++) {
        setTimeout(post,0,MSG[type].flx[i](body));
Severity: Minor
Found in prototypes/express/src/old/fluxion.js - 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 linePoint has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function linePoint(x, y) {
        x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x));
        y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y));
        var v = pointVisible(x, y);
        if (polygon) ring.push([ x, y ]);
Severity: Minor
Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

    Function extent has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        brush.extent = function(z) {
          var x0, x1, y0, y1, t;
          if (!arguments.length) {
            if (x) {
              if (xExtentDomain) {
    Severity: Minor
    Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

      Function pack has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        d3.layout.pack = function() {
          var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius;
          function pack(d, i) {
            var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() {
              return radius;
      Severity: Minor
      Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

        Function onMove has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              function onMove(e) {
                if (!self.settings('eventsEnabled'))
                  return;
        
                nodes = getNodes(e);

          Function router has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function router() {
              cloud = zmq.socket('sub');
              output = zmq.socket('pub');
              ctl = zmq.socket('rep');
          
          
          Severity: Minor
          Found in prototypes/zeromq/src/node.js - About 1 hr to fix

            Function _moveHandler has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function _moveHandler(e) {
                  var x,
                      y,
                      pos;
            
            

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              function mean(array) {
                var _sum = 0;
                for (var i = 0; i < array.length; i++) {
                  _sum += array[i];
                };
              Severity: Major
              Found in prototypes/fluxions/bench/distribution/index.js and 1 other location - About 1 hr to fix
              prototypes/fluxions/bench/stats/index.js on lines 1..7

              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 66.

              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

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              function mean(array) {
                var _sum = 0;
                for (var i = 0; i < array.length; i++) {
                  _sum += array[i];
                };
              Severity: Major
              Found in prototypes/fluxions/bench/stats/index.js and 1 other location - About 1 hr to fix
              prototypes/fluxions/bench/distribution/index.js on lines 174..180

              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 66.

              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

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              function async() {
                var args = Array.prototype.slice.call(arguments);
                var cb = args.pop();
                setTimeout(function() {
                  cb.apply(this, args);
              Severity: Major
              Found in examples/higher-order.js and 1 other location - About 1 hr to fix
              examples/control-flow.js on lines 32..38

              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 66.

              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

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              function async() {
                var args = Array.prototype.slice.call(arguments);
                var cb = args.pop();
                setTimeout(function() {
                  cb.apply(this, args);
              Severity: Major
              Found in examples/control-flow.js and 1 other location - About 1 hr to fix
              examples/higher-order.js on lines 44..50

              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 66.

              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 2 locations. Consider refactoring.
              Open

                v = {
                  x: (t[p + 'x'] - s[p + 'x']) / d,
                  y: (t[p + 'y'] - s[p + 'y']) / d
                };
              Severity: Major
              Found in prototypes/express/src/console/script.js and 1 other location - About 1 hr to fix
              prototypes/express/src/console/script.js on lines 264..267

              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 66.

              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 2 locations. Consider refactoring.
              Open

                v = {
                  x: (t[p + 'x'] - s[p + 'x']) / d,
                  y: (t[p + 'y'] - s[p + 'y']) / d
                };
              Severity: Major
              Found in prototypes/express/src/console/script.js and 1 other location - About 1 hr to fix
              prototypes/express/src/console/script.js on lines 208..211

              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 66.

              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

              Function linePoint has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function linePoint(λ, φ) {
                    var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]);
                    if (p0) {
                      var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal);
                      d3_geo_cartesianNormalize(inflection);
              Severity: Minor
              Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

                Function d3_geo_pathContext has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function d3_geo_pathContext(context) {
                    var pointRadius = 4.5;
                    var stream = {
                      point: point,
                      lineStart: function() {
                Severity: Minor
                Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language