etnbrd/flx-compiler

View on GitHub

Showing 1,229 of 1,229 total issues

Function exports has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function (mongoose, connString) {

    if (connString) {
        mongoose.connect(connString, function (err) {
            // if we failed to connect, abort
Severity: Minor
Found in test-set/Moonridge-master/main.js - About 2 hrs 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 2 locations. Consider refactoring.
Open

      var xhr = (function() {
        if (window.XMLHttpRequest)
          return new XMLHttpRequest();

        var names,
prototypes/express/src/console/sigma/plugins/sigma.parsers.gexf/gexf-parser.js on lines 414..436

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

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

    var xhr = (function() {
      if (window.XMLHttpRequest)
        return new XMLHttpRequest();

      var names,
prototypes/express/src/console/sigma/plugins/sigma.plugins.neighborhoods/sigma.plugins.neighborhoods.js on lines 134..156

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

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

File gexf-parser.js has 287 lines of code (exceeds 250 allowed). Consider refactoring.
Open

;(function(undefined) {
  'use strict';

  /**
   * GEXF Parser

    Function d3_geom_voronoiConnectEdge has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function d3_geom_voronoiConnectEdge(edge, extent) {
        var vb = edge.b;
        if (vb) return true;
        var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb;
        if (ry === ly) {
    Severity: Major
    Found in lib/graph-printer/old/bower_components/d3/d3.js - About 2 hrs to fix

      Function graticule has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        d3.geo.graticule = function() {
          var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5;
          function graticule() {
            return {
              type: "MultiLineString",
      Severity: Major
      Found in lib/graph-printer/old/bower_components/d3/d3.js - About 2 hrs to fix

        Function d3_xhr has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function d3_xhr(url, mimeType, response, callback) {
            var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null;
            if (d3_window.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
            "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {
              request.readyState > 3 && respond();
        Severity: Major
        Found in lib/graph-printer/old/bower_components/d3/d3.js - About 2 hrs to fix

          Function def has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            sigma.canvas.hovers.def = function(node, context, settings) {
              var x,
                  y,
                  w,
                  h,

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

            function _hash(n, salt) {
              return "" +
                n.loc.start.line +
                n.loc.start.column +
                n.loc.end.line +
            Severity: Major
            Found in prototypes/blender.old/lib/dependency.js and 4 other locations - About 2 hrs to fix
            prototypes/blender.old/lib/helpers.js on lines 13..21
            prototypes/blender/lib/helpers.js on lines 25..33
            prototypes/shreder/lib/helpers.js on lines 25..33
            lib/lib/helpers.js on lines 7..15

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

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

            function hash(n, _salt) {
              return "" +
                n.loc.start.line +
                n.loc.start.column +
                n.loc.end.line +
            Severity: Major
            Found in prototypes/shreder/lib/helpers.js and 4 other locations - About 2 hrs to fix
            prototypes/blender.old/lib/dependency.js on lines 50..58
            prototypes/blender.old/lib/helpers.js on lines 13..21
            prototypes/blender/lib/helpers.js on lines 25..33
            lib/lib/helpers.js on lines 7..15

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

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

            function hash(n, _salt) {
              return "" +
                n.loc.start.line +
                n.loc.start.column +
                n.loc.end.line +
            Severity: Major
            Found in prototypes/blender/lib/helpers.js and 4 other locations - About 2 hrs to fix
            prototypes/blender.old/lib/dependency.js on lines 50..58
            prototypes/blender.old/lib/helpers.js on lines 13..21
            prototypes/shreder/lib/helpers.js on lines 25..33
            lib/lib/helpers.js on lines 7..15

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

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

            function _hash(n, salt) {
              return "" +
                n.loc.start.line +
                n.loc.start.column +
                n.loc.end.line +
            Severity: Major
            Found in prototypes/blender.old/lib/helpers.js and 4 other locations - About 2 hrs to fix
            prototypes/blender.old/lib/dependency.js on lines 50..58
            prototypes/blender/lib/helpers.js on lines 25..33
            prototypes/shreder/lib/helpers.js on lines 25..33
            lib/lib/helpers.js on lines 7..15

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

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

            function hash(node, _salt) {
              return '' +
                node.loc.start.line +
                node.loc.start.column +
                node.loc.end.line +
            Severity: Major
            Found in lib/lib/helpers.js and 4 other locations - About 2 hrs to fix
            prototypes/blender.old/lib/dependency.js on lines 50..58
            prototypes/blender.old/lib/helpers.js on lines 13..21
            prototypes/blender/lib/helpers.js on lines 25..33
            prototypes/shreder/lib/helpers.js on lines 25..33

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

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

              function d3_svg_area(projection) {
                var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7;
                function area(data) {
                  var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() {
                    return x;
            Severity: Major
            Found in lib/graph-printer/old/bower_components/d3/d3.js - About 2 hrs to fix

              Function quadtree has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function quadtree(data) {
                    var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_;
                    if (x1 != null) {
                      x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2;
                    } else {
              Severity: Major
              Found in lib/graph-printer/old/bower_components/d3/d3.js - About 2 hrs to fix

                Function matcherFromGroupMatchers has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                    // A counter to specify which element is currently being matched
                    var matcherCachedRuns = 0,
                        bySet = setMatchers.length > 0,
                        byElement = elementMatchers.length > 0,
                Severity: Major
                Found in test-set/gifsockets-server-master/public/js/jquery.js - About 2 hrs to fix

                  File index.js has 285 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  var recast = require("recast");
                  var b = require("recast").types.builders;
                  var fs = require("fs");
                  var util = require("util");
                  
                  
                  Severity: Minor
                  Found in prototypes/blender.old/index.js - About 2 hrs to fix

                    Function isFunction has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Context.prototype.isFunction = function(id) {
                    
                      // TODO this function is a mess : refactor.
                    
                      if (id.context) {
                    Severity: Major
                    Found in lib/analyzer/context.js - About 2 hrs to fix

                      Function d3_geo_projectionMutator has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function d3_geo_projectionMutator(projectAt) {
                          var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) {
                            x = project(x, y);
                            return [ x[0] * k + δx, δy - x[1] * k ];
                          }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream;
                      Severity: Major
                      Found in lib/graph-printer/old/bower_components/d3/d3.js - About 2 hrs to fix

                        Function add has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            add: function( elem, types, handler, data, selector ) {
                                var tmp, events, t, handleObjIn,
                                    special, eventHandle, handleObj,
                                    handlers, type, namespaces, origType,
                                    elemData = jQuery._data( elem );
                        Severity: Major
                        Found in test-set/gifsockets-server-master/public/js/jquery.js - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language