etnbrd/flx-compiler

View on GitHub

Showing 1,229 of 1,229 total issues

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

function post(msg) {

  function postMsg(msg) {
    if (!msg)
      return false;
Severity: Minor
Found in prototypes/fluxions/lib/flx_nextTick.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 11 (exceeds 5 allowed). Consider refactoring.
Open

function post(msg) {

  function postMsg(msg) {
    if (!msg)
      return false;
Severity: Minor
Found in prototypes/fluxions/lib/flx.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 walk has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function walk(o, cb) {

    function _walk_o (o) {
        // console.log(">> walking object");
        for (var i in o) {
Severity: Minor
Found in prototypes/esprima/main.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

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

      var bottomNode = varChain.nodes.filter(function(node) {
        return varChain.deps.every(function(dep) {
          return dep.id !== node.id;
        })
      })
Severity: Major
Found in prototypes/blender/lib/extraction.js and 2 other locations - About 1 hr to fix
prototypes/blender.old/index.js on lines 202..206
prototypes/blender.old/index.js on lines 287..291

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

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 _pre(c) {
  var _output = "";
  for (var i = 0; i < c.length; i++) {
    _output += "  ";
  };
Severity: Major
Found in prototypes/blender.old/lib/dependency.js and 1 other location - About 1 hr to fix
prototypes/blender.old/lib/helpers.js on lines 5..11

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

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

    if (!color)
      switch (edgeColor) {
        case 'source':
          color = source.color || defaultNodeColor;
          break;
prototypes/express/src/console/sigma/src/renderers/canvas/sigma.canvas.edges.arrow.js on lines 33..44

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

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

var bottomNode = argChain.nodes.find(function(node) {
  return argChain.deps.every(function(dep) {
    return dep.id !== node.id;
  })
})
Severity: Major
Found in prototypes/blender.old/index.js and 2 other locations - About 1 hr to fix
prototypes/blender.old/index.js on lines 202..206
prototypes/blender/lib/extraction.js on lines 79..83

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

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

    var bottomNode = varChain.nodes.find(function(node) {
      return varChain.deps.every(function(dep) {
        return dep.id !== node.id;
      })
    })
Severity: Major
Found in prototypes/blender.old/index.js and 2 other locations - About 1 hr to fix
prototypes/blender.old/index.js on lines 287..291
prototypes/blender/lib/extraction.js on lines 79..83

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

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

    if (!color)
      switch (edgeColor) {
        case 'source':
          color = source.color || defaultNodeColor;
          break;
prototypes/express/src/console/sigma/src/renderers/canvas/sigma.canvas.edges.def.js on lines 20..31

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

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

    return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l);
Severity: Major
Found in lib/graph-printer/old/bower_components/d3/d3.js and 1 other location - About 1 hr to fix
lib/graph-printer/old/bower_components/d3/d3.js on lines 1577..1577

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

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 _pre(c) {
  var _output = "";
  for (var i = 0; i < c.length; i++) {
    _output += "  ";
  };
Severity: Major
Found in prototypes/blender.old/lib/helpers.js and 1 other location - About 1 hr to fix
prototypes/blender.old/lib/dependency.js on lines 42..48

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

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

    return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b);
Severity: Major
Found in lib/graph-printer/old/bower_components/d3/d3.js and 1 other location - About 1 hr to fix
lib/graph-printer/old/bower_components/d3/d3.js on lines 1488..1488

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

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 d3_scale_quantile has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function d3_scale_quantile(domain, range) {
    var thresholds;
    function rescale() {
      var k = 0, q = range.length;
      thresholds = [];
Severity: Minor
Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

    Function d3_rgb_parse has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function d3_rgb_parse(format, rgb, hsl) {
        var r = 0, g = 0, b = 0, m1, m2, color;
        m1 = /([a-z]+)\((.*)\)/i.exec(format);
        if (m1) {
          m2 = m1[2].split(",");
    Severity: Minor
    Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

      Function event has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          zoom.event = function(g) {
            g.each(function() {
              var dispatch = event.of(this, arguments), view1 = view;
              if (d3_transitionInheritId) {
                d3.select(this).transition().each("start.zoom", function() {
      Severity: Minor
      Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

        Function d3_geom_voronoiAttachCircle has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function d3_geom_voronoiAttachCircle(arc) {
            var lArc = arc.P, rArc = arc.N;
            if (!lArc || !rArc) return;
            var lSite = lArc.site, cSite = arc.site, rSite = rArc.site;
            if (lSite === rSite) return;
        Severity: Minor
        Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

          Function arc has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            d3.svg.arc = function() {
              var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
              function arc() {
                var r0 = innerRadius.apply(this, arguments), r1 = outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset, a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset, da = (a1 < a0 && (da = a0, 
                a0 = a1, a1 = da), a1 - a0), df = da < π ? "0" : "1", c0 = Math.cos(a0), s0 = Math.sin(a0), c1 = Math.cos(a1), s1 = Math.sin(a1);
          Severity: Minor
          Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

            Function processCSI has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            timbits.processCSI = function(index, element) {
              var include = jQuery(element);
              var src = include.attr('data-csi');
              var process_this = true;
            
            
            Severity: Minor
            Found in test-set/timbits-master/resources/javascript/timbits.csi.js - About 1 hr to fix

              Function update has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    update: function(toUpdate) {
              
                      var def = Promise.defer();
                      var socket = this;
                      var id = toUpdate._id;
              Severity: Minor
              Found in test-set/Moonridge-master/mr-rpc-methods.js - About 1 hr to fix

                Function applyPlacement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  , applyPlacement: function(offset, placement){
                      var $tip = this.tip()
                        , width = $tip[0].offsetWidth
                        , height = $tip[0].offsetHeight
                        , actualWidth
                Severity: Minor
                Found in test-set/gifsockets-server-master/public/js/bootstrap.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language