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

    if (drawLabels) {
      renderers = sigma.canvas.labels;
      for (a = this.nodesOnScreen, i = 0, l = a.length; i < l; i++)
        (renderers[a[i].type] || renderers.def)(
          a[i],
prototypes/express/src/console/sigma/src/renderers/sigma.renderers.canvas.js on lines 245..253

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

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

    if (drawNodes) {
      renderers = sigma.canvas.nodes;
      for (a = this.nodesOnScreen, i = 0, l = a.length; i < l; i++)
        (renderers[a[i].type] || renderers.def)(
          a[i],
prototypes/express/src/console/sigma/src/renderers/sigma.renderers.canvas.js on lines 257..265

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

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

  sigma.misc.animation.camera = function(camera, val, options) {
    if (
      !(camera instanceof sigma.classes.camera) ||
      typeof val !== 'object' ||
      !val
Severity: Major
Found in prototypes/express/src/console/sigma/src/misc/sigma.misc.animation.js - About 3 hrs to fix

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

    function _routerIncId(id, count) {
      // La séparation des deux patterns (associativité et persistence)
      // dans router + routerId et routerId + incId n'est pas necessaire
      // Cette fluxion contracte routerId et incId en une seule fluxion
      return function(msg) {
    Severity: Major
    Found in prototypes/express/src/old/fluxion-pure.js and 1 other location - About 3 hrs to fix
    prototypes/express/src/old/fluxion-pure.js on lines 69..81

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

    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

    function _incId(id, count) {
    // Cette fluxion, a la reception d'un message va se remplacer en incrémentant son contexte
    // Puis elle envoie un message à la fluxion chargé de cette connection, connu grace au uuid
    // Ce pattern (routerId + incId) permet de diluer la persistence d'une valeur
    
    
    Severity: Major
    Found in prototypes/express/src/old/fluxion-pure.js and 1 other location - About 3 hrs to fix
    prototypes/express/src/old/fluxion-pure.js on lines 83..94

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

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

    module.exports = function(options) {
      var cipher = encryptor(options.encryptionSecret);
    
      return function(req, res, next) {
        var userSession = getUserSession(req, options.sessionSyncNonce);
    Severity: Minor
    Found in test-set/node-heroku-bouncer-master/lib/middleware.js - About 3 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

    Function Sizzle has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Sizzle( selector, context, results, seed ) {
        var match, elem, m, nodeType,
            // QSA vars
            i, groups, old, nid, newContext, newSelector;
    
    
    Severity: Major
    Found in test-set/gifsockets-server-master/public/js/jquery.js - About 3 hrs to fix

      Function d3_geo_resample has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function d3_geo_resample(project) {
          var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16;
          function resample(stream) {
            return (maxDepth ? resampleRecursive : resampleNone)(stream);
          }
      Severity: Major
      Found in lib/graph-printer/old/bower_components/d3/d3.js - About 3 hrs to fix

        Function albersUsa has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          d3.geo.albersUsa = function() {
            var lower48 = d3.geo.albers();
            var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]);
            var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]);
            var point, pointStream = {
        Severity: Major
        Found in lib/graph-printer/old/bower_components/d3/d3.js - About 3 hrs to fix

          File sigma.captors.touch.js has 293 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ;(function(undefined) {
            'use strict';
          
            if (typeof sigma === 'undefined')
              throw 'sigma is not declared';

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

                while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) {
                  next = rArc.N;
                  disappearing.push(rArc);
                  d3_geom_voronoiDetachBeach(rArc);
                  rArc = next;
            Severity: Major
            Found in lib/graph-printer/old/bower_components/d3/d3.js and 1 other location - About 3 hrs to fix
            lib/graph-printer/old/bower_components/d3/d3.js on lines 4819..4824

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

            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

                while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) {
                  previous = lArc.P;
                  disappearing.unshift(lArc);
                  d3_geom_voronoiDetachBeach(lArc);
                  lArc = previous;
            Severity: Major
            Found in lib/graph-printer/old/bower_components/d3/d3.js and 1 other location - About 3 hrs to fix
            lib/graph-printer/old/bower_components/d3/d3.js on lines 4828..4833

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

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

              function d3_locale_numberFormat(locale) {
                var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping ? function(value) {
                  var i = value.length, t = [], j = 0, g = locale_grouping[0];
                  while (i > 0 && g > 0) {
                    t.push(value.substring(i -= g, i + g));
            Severity: Major
            Found in lib/graph-printer/old/bower_components/d3/d3.js - About 2 hrs to fix

              Function d3_scale_ordinal has 74 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function d3_scale_ordinal(domain, ranger) {
                  var index, range, rangeBand;
                  function scale(x) {
                    return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length];
                  }
              Severity: Major
              Found in lib/graph-printer/old/bower_components/d3/d3.js - About 2 hrs to fix

                Function buildFragment has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    buildFragment: function( elems, context, scripts, selection ) {
                        var j, elem, contains,
                            tmp, tag, tbody, wrap,
                            l = elems.length,
                
                
                Severity: Major
                Found in test-set/gifsockets-server-master/public/js/jquery.js - About 2 hrs to fix

                  Function MRModel has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function MRModel(name, schema, opts) {
                      opts = opts || {};
                  
                      /**
                       * is overriden for liveQueries
                  Severity: Major
                  Found in test-set/Moonridge-master/mr-server-model.js - About 2 hrs to fix

                    Function liveQuery has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        liveQuery: function(clientQuery, LQIndex) {
                          if (!opts.checkPermission(this, 'R')) {
                            return new Error('You lack a privilege to read this collection');
                          }
                          def = Promise.defer();
                    Severity: Major
                    Found in test-set/Moonridge-master/mr-rpc-methods.js - About 2 hrs to fix

                      Function processFileList has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function processFileList(e, files, opts) {
                      
                              var filesLeft = files.length;
                              var group = {
                                  groupID: getGroupID(),
                      Severity: Major
                      Found in test-set/gifsockets-server-master/public/js/filereader.js - About 2 hrs to fix

                        Function _addJob has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function _addJob(v1, v2) {
                            var i,
                                l,
                                o;
                        
                        
                        Severity: Major
                        Found in prototypes/express/src/console/sigma/src/conrad.js - About 2 hrs to fix

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

                          function _next(tree, chain, node) {
                          
                            // TODO What about building this fucking _next function so I don't have to pass these tree and chain as arguments every fucking time !
                          
                            // console.log(">> ", node, node.kind);
                          Severity: Minor
                          Found in prototypes/blender.old/index.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

                          Severity
                          Category
                          Status
                          Source
                          Language