etnbrd/flx-compiler

View on GitHub

Showing 1,229 of 1,229 total issues

Function _distributeChange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _distributeChange: function(doc, evName, isInResult) {
      var self = this;
      var actuallySend = function() {
        for (var socketId in self.listeners) {
          var listener = self.listeners[socketId];
Severity: Minor
Found in test-set/Moonridge-master/mr-rpc-methods.js - About 1 hr to fix

    Function _register has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function _register(msg) {
      s.graph.addNode({
        id: msg.name,
        size: nodeRadius,
        x: Math.random(),
    Severity: Minor
    Found in prototypes/express/src/console/script.js - About 1 hr to fix

      Function accessControlQueryModifier has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function accessControlQueryModifier(clQuery, schema, userPL, op) { // guards the properties that are marked with higher required permissions for reading
          var pathPs = schema.pathPermissions;
          var select;
          if (clQuery.select) {
            select = clQuery.select[0];
      Severity: Minor
      Found in test-set/Moonridge-master/mr-rpc-methods.js - About 1 hr to fix

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

                      n.fa2 = {
                        mass: 1 + self.graph.degree(n.id),
                        old_dx: 0,
                        old_dy: 0,
                        dx: 0,
        prototypes/express/src/console/sigma/plugins/sigma.layout.forceAtlas2/sigma.layout.forceAtlas2.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 57.

        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

                n.fa2 = {
                  mass: 1 + self.graph.degree(n.id),
                  old_dx: 0,
                  old_dy: 0,
                  dx: 0,
        prototypes/express/src/console/sigma/plugins/sigma.layout.forceAtlas2/sigma.layout.forceAtlas2.js on lines 79..85

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

        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 timestamp has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          , timestamp: function(name) {
              return function(vals, cb) {
                try {
                  var mapped = vals.map(function(val) {
                    if (val.match(/^-?[0-9]+(\.[0-9]+)?$/)) {
        Severity: Minor
        Found in test-set/express-endpoint-master/lib/rules.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 enter has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          enter: function (n, p, c) {
        
            // TODO if the function is used for more than the async call, we NEED to run the mapping concurrently for two fluxion : the old, and the new.
        
            if (n.rupturePoint) {
        Severity: Minor
        Found in lib/mapper/iterator.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 end has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        Context.prototype.end = function() {
        
          function registerDependency(variable, flx, ref){
            if (!flx.dependencies[variable.name]) {
              flx.dependencies[variable.name] = {
        Severity: Minor
        Found in lib/mapper/context.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 _reducer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function _reducer() {
        
          function reduce(n, it) {
        
            function _agg(n) {
        Severity: Minor
        Found in prototypes/shreder/lib/traverse.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 d3_geom_voronoi has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function d3_geom_voronoi(sites, bbox) {
            var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle;
            d3_geom_voronoiEdges = [];
            d3_geom_voronoiCells = new Array(sites.length);
            d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree();
        Severity: Minor
        Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

          Function brushmove has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                function brushmove() {
                  var point = d3.mouse(target), moved = false;
                  if (offset) {
                    point[0] += offset[0];
                    point[1] += offset[1];
          Severity: Minor
          Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

            Function d3_geo_pointInPolygon has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function d3_geo_pointInPolygon(point, polygon) {
                var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
                d3_geo_areaRingSum.reset();
                for (var i = 0, n = polygon.length; i < n; ++i) {
                  var ring = polygon[i], m = ring.length;
            Severity: Minor
            Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

              Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      setup: function() {
              
                          if ( rformElems.test( this.nodeName ) ) {
                              // IE doesn't fire change on a check/radio until blur; trigger it on click
                              // after a propertychange. Eat the blur-change in special.change.handle.
              Severity: Minor
              Found in test-set/gifsockets-server-master/public/js/jquery.js - About 1 hr to fix

                Function propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function propFilter( props, specialEasing ) {
                    var value, name, index, easing, hooks;
                
                    // camelCase, specialEasing and expand cssHook pass
                    for ( index in props ) {
                Severity: Minor
                Found in test-set/gifsockets-server-master/public/js/jquery.js - About 1 hr to fix

                  Function bodyParser has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var bodyParser = function () {
                      var getRawBody = require('raw-body');
                      module.exports = function getRawBodyFn(limit) {
                        return function saveBody(req, res, next) {
                          getRawBody(/*msg._sign.*/req, {
                  Severity: Minor
                  Found in test-set/gifsockets-server-master/server/app.js - About 1 hr to fix

                    Function bind has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      dispatcher.prototype.bind = function(events, handler) {
                        var i,
                            event,
                            eArray;
                    
                    

                      Function unbind has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        dispatcher.prototype.unbind = function(events, handler) {
                          var i,
                              j,
                              a,
                              event,

                        Function postPlaceholder has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function postPlaceholder(next, signature) {
                        
                          return b.callExpression(
                                  b.memberExpression(
                                    b.identifier("flx"),
                        Severity: Minor
                        Found in prototypes/shreder/lib/builders.js - About 1 hr to fix

                          Function graph has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function graph(type, options) {
                            this._options = options;
                            this._output_pre = _bgraph + "\\begin{" + type + "}";
                            this._output_post = "\\end{" + type + "}\n"+ _egraph;
                            this._plots = [];
                          Severity: Minor
                          Found in prototypes/fluxions/bench/distribution/pgfplots.js - About 1 hr to fix

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

                            try {
                              var hooks = require('./hooks')
                            } catch(err) {
                              // For debug purpose
                              // console.log("No hooks module found, fallback to debug");
                            Severity: Major
                            Found in prototypes/fluxions/lib/flx.js and 3 other locations - About 1 hr to fix
                            prototypes/fluxions/lib/flx_chain.js on lines 4..17
                            prototypes/fluxions/lib/flx_nextTick.js on lines 4..17
                            prototypes/fluxions/lib/flx_setTimeout.js on lines 4..17

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

                            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