etnbrd/flx-compiler

View on GitHub

Showing 623 of 1,229 total issues

Function populateSessionWithUser has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function populateSessionWithUser(cb) {
      return function(err, body, headers) {
        if (err) { return cb(err); }

        getUserName(body.name, headers['set-cookie'], function(err, name) {
Severity: Minor
Found in test-set/express-couchUser-master/index.js - About 1 hr to fix

    Function exposeCallback has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      return function exposeCallback(rpcInstance) {
        var chnlName = 'MR-' + modelName; //prefix MR stands for Moonridge
        rpcInstance.expose(chnlName, channel, opts.authFn);
        var chnlSocket = rpcInstance.channels[chnlName]._socket;
    
    
    Severity: Minor
    Found in test-set/Moonridge-master/mr-rpc-methods.js - About 1 hr to fix

      Function keydown has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        , keydown: function (e) {
            var $this
              , $items
              , $active
              , $parent
      Severity: Minor
      Found in test-set/gifsockets-server-master/public/js/bootstrap.js - About 1 hr to fix

        Function setupClipboard has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function setupClipboard(element, opts) {
        
                if (!FileReaderJS.enabled) {
                    return;
                }
        Severity: Minor
        Found in test-set/gifsockets-server-master/public/js/filereader.js - About 1 hr to fix

          Function _resolve has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function _resolve(tree, forest) {
          
            // console.log(forest);
          
            tree.deps.every(function(dep) {
          Severity: Minor
          Found in prototypes/blender.old/lib/resolution.js - About 1 hr to fix

            Function splitSquare has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                splitSquare: function(b) {
                  return [
                    [
                      {x: b.x, y: b.y},
                      {x: b.x + b.width / 2, y: b.y},

              Function _executeFirstJob has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function _executeFirstJob() {
                  var i,
                      l,
                      test,
                      kill,
              Severity: Minor
              Found in prototypes/express/src/console/sigma/src/conrad.js - About 1 hr to fix

                Function resize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  sigma.renderers.canvas.prototype.resize = function(w, h) {
                    var k,
                        oldWidth = this.width,
                        oldHeight = this.height,
                        pixelRatio = 1;

                  Function updateMassAndGeometry has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    forceatlas2.Region.prototype.updateMassAndGeometry = function() {
                      if (this.nodes.length > 1) {
                        // Compute Mass
                        var mass = 0;
                        var massSumX = 0;

                    Function area has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      quad.prototype.area = function(rect) {
                        var serialized = JSON.stringify(rect),
                            collisionFunc,
                            rectData;
                    
                    

                      Function enter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        enter: function(n, c) {
                      
                          // TODO this is bad design
                          var _c = {id: ""};
                          map(n.callee, _getId(_c));
                      Severity: Minor
                      Found in prototypes/shreder/lib/transform.js - About 1 hr to fix

                        Function bench has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function bench(ITERATION) {
                          // LOOP
                          start = time.now();
                          for(var i=0; i < ITERATION; i++){
                            loop();
                        Severity: Minor
                        Found in prototypes/fluxions/bench/distribution/setTimeout.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                            if (ids.length === 2 &&
                            (    this.postTriggers.indexOf(ids[0]) > -1 && expressRoutes.indexOf(ids[1]) > -1
                              || this.postTriggers.indexOf(ids[0]) > -1 && fsMethods.indexOf(ids[1]) > -1)
                            ||  ids.length === 1 &&
                            (    this.postTriggers.indexOf(ids[0]) > -1)) {
                          Severity: Major
                          Found in lib/analyzer/triggers.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                              if (ids.length === 2 &&
                              (    this.startTriggers.indexOf(ids[0]) > -1 && expressRoutes.indexOf(ids[1]) > -1
                                || this.startTriggers.indexOf(ids[0]) > -1 && fsMethods.indexOf(ids[1]) > -1)
                              ||  ids.length === 1 &&
                              (    this.startTriggers.indexOf(ids[0]) > -1)) {
                            Severity: Major
                            Found in lib/analyzer/triggers.js - About 1 hr to fix

                              Function insert has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                    function insert(n, d, x, y, x1, y1, x2, y2) {
                              Severity: Major
                              Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

                                Function insertChild has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                      function insertChild(n, d, x, y, x1, y1, x2, y2) {
                                Severity: Major
                                Found in lib/graph-printer/old/bower_components/d3/d3.js - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                  if ( jQuery.expr && jQuery.expr.filters ) {
                                      jQuery.expr.filters.hidden = function( elem ) {
                                          // Support: Opera <= 12.12
                                          // Opera reports offsetWidths and offsetHeights less than zero on some elements
                                          return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
                                  Severity: Major
                                  Found in test-set/gifsockets-server-master/public/js/jquery.js - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                    if ( unit !== "px" && start ) {
                                                        // Iteratively approximate from a nonzero starting point
                                                        // Prefer the current property, because this process will be trivial if it uses the same units
                                                        // Fallback to end or a simple constant
                                                        start = jQuery.css( tween.elem, prop, true ) || end || 1;
                                    Severity: Major
                                    Found in test-set/gifsockets-server-master/public/js/jquery.js - About 1 hr to fix

                                      Function callback has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        , callback: function(name) {
                                            return function(vals, cb) {
                                              if (vals.length > 1) {
                                                cb(new Error("The parameter can only be specified once"))
                                              } else {
                                      Severity: Minor
                                      Found in test-set/express-endpoint-master/lib/rules.js - About 55 mins 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 iteratorFactory has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      module.exports = function iteratorFactory(typesWalker) {
                                          return function iterator(context) {
                                              function handlerFactory(visitorEvent) {
                                                  return function handler(node, parent) {
                                                      if (!node.type)
                                      Severity: Minor
                                      Found in lib/lib/iterators.js - About 55 mins 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