neyric/wireit

View on GitHub

Showing 179 of 497 total issues

File editor.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
Open

YUI.add("editor", function(Y){

/**
 * The WiringEditor class provides a full page interface 
 * @class WiringEditor
Severity: Minor
Found in sandbox/editor/editor.js - About 4 hrs to fix

    Function execute has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

       execute: function(moduleId,params) {
          
          try {
             
          
    Severity: Minor
    Found in sandbox/jsBox/ExecutionFrame.js - About 4 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 xmlParse has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function xmlParse(xml) {
      var regex_empty = /\/$/;
    
      var regex_tagname;
      var regex_attribute;
    Severity: Major
    Found in sandbox/grouping/examples/sawire/xml/dom.js - About 3 hrs to fix

      Function draw has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

         draw: function() {    
      
             // Get the positions of the terminals
             var p1 = this.terminal1.getXY();
             var p2 = this.terminal2.getXY();
      Severity: Major
      Found in sandbox/wireit-leftsquarearrow-wire/wireit-leftsquarearrow-wire.js - About 3 hrs to fix

        Function draw has 94 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

           draw: function() {    
        
              // Get the positions of the terminals
              var p1 = this.terminal1.getXY();
              var p2 = this.terminal2.getXY();
        Severity: Major
        Found in sandbox/wireit-rightsquarearrow-wire/wireit-rightsquarearrow-wire.js - About 3 hrs to fix

          xpathfunctions has 30 functions (exceeds 20 allowed). Consider refactoring.
          Open

          FunctionCallExpr.prototype.xpathfunctions = {
            'last': function(ctx) {
              assert(this.args.length == 0);
              // NOTE(mesch): XPath position starts at 1.
              return new NumberValue(ctx.contextSize());
          Severity: Minor
          Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 3 hrs to fix

            Function xpathParse has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            function xpathParse(expr) {
              xpathLog('parse ' + expr);
              xpathParseInit();
            
              var cached = xpathCacheLookup(expr);
            Severity: Minor
            Found in sandbox/grouping/examples/sawire/xml/xpath.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 evaluate has 89 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            StepExpr.prototype.evaluate = function(ctx) {
              var input = ctx.node;
              var nodelist = [];
              var skipNodeTest = false;
              
            Severity: Major
            Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 3 hrs to fix

              File util.js has 310 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // Copyright 2005 Google
              //
              // Author: Steffen Meschkat <mesch@google.com>
              //
              // Miscellaneous utility and placeholder functions.
              Severity: Minor
              Found in sandbox/grouping/examples/sawire/xml/util.js - About 3 hrs to fix

                File wireit-app-debug.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                YUI.add('wireit-app', function (Y, NAME) {
                
                
                // -- LocalStorageSync ---------------------------------------------------------------------
                // Saves WiringModel
                Severity: Minor
                Found in build/wireit-app/wireit-app-debug.js - About 3 hrs to fix

                  File wireit-app.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  YUI.add('wireit-app', function (Y, NAME) {
                  
                  
                  // -- LocalStorageSync ---------------------------------------------------------------------
                  // Saves WiringModel
                  Severity: Minor
                  Found in build/wireit-app/wireit-app.js - About 3 hrs to fix

                    Function execute has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                       execute: function(moduleId,params) {
                          
                          try {
                             
                          
                    Severity: Major
                    Found in sandbox/jsBox/ExecutionFrame.js - About 3 hrs to fix

                      Function xpathParse has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function xpathParse(expr) {
                        xpathLog('parse ' + expr);
                        xpathParseInit();
                      
                        var cached = xpathCacheLookup(expr);
                      Severity: Major
                      Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 3 hrs to fix

                        Function xpathMatchStack has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function xpathMatchStack(stack, pattern) {
                        
                          // NOTE(mesch): The stack matches for variable cardinality are
                          // greedy but don't do backtracking. This would be an issue only
                          // with rules of the form A* A, i.e. with an element with variable
                        Severity: Minor
                        Found in sandbox/grouping/examples/sawire/xml/xpath.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 loadLevel has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                loadLevel: function(level) {
                        
                                   Y.one('#levelContainer').innerHTML = level;
                        
                                   var c = level+2;
                        Severity: Major
                        Found in sandbox/planar-game/planar-game.js - About 3 hrs to fix

                          Function run has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              run: function() {
                                  
                                  var i, j, l;
                                  
                                  // Extract nodes positions
                          Severity: Major
                          Found in sandbox/wireit-layout/wireit-layout.js - About 3 hrs to fix

                            Function xmlTextR has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function xmlTextR(node, buf, cdata) {
                              if (node.nodeType == DOM_TEXT_NODE) {
                                buf.push(xmlEscapeText(node.nodeValue));
                            
                              } else if (node.nodeType == DOM_CDATA_SECTION_NODE) {
                            Severity: Minor
                            Found in sandbox/grouping/examples/sawire/xml/util.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 generateFieldMap has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                generateFieldMap: function(group, usedNames, containerMap, groupMap)
                                {
                                    var self = this;
                                    
                                    var allContainers = [];
                            Severity: Major
                            Found in sandbox/grouping/js/GroupUtils.js - About 3 hrs to fix

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

                                  addWireConfig: function(group, getInternalContainerId, getExternalTerminalName, externalWires, internalWires, groupIndex)
                                  {
                                      var pushUniqueWireConfig = function(wires, newWire) {
                                        var foundWire= false;
                                        var wire;
                              Severity: Major
                              Found in sandbox/grouping/js/GroupUtils.js - About 2 hrs to fix

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

                                BinaryExpr.prototype.compare = function(ctx, cmp) {
                                  var v1 = this.expr1.evaluate(ctx);
                                  var v2 = this.expr2.evaluate(ctx);
                                
                                  var ret;
                                Severity: Major
                                Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language