neyric/wireit

View on GitHub

Showing 497 of 497 total issues

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

             "container": {
                  "xtype":"Y.ImageContainer", 
                  "image": "../logicGates/images/gate_and.png",
                  "icon": "../../assets/arrow_join.png",
                  "terminals": [
Severity: Major
Found in sandbox/grouping/examples/WiringEditor/embedded.js and 1 other location - About 4 hrs to fix
sandbox/editor-examples/WiringEditor/demo.js on lines 62..71

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

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

             "container": {
                  "xtype":"Y.ImageContainer", 
                  "image": "../logicGates/images/gate_and.png",
                  "icon": "../../assets/arrow_join.png",
                  "terminals": [
Severity: Major
Found in sandbox/editor-examples/WiringEditor/demo.js and 1 other location - About 4 hrs to fix
sandbox/grouping/examples/WiringEditor/embedded.js on lines 182..191

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

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

function xpathReduce(stack, ahead) {
  var cand = null;

  if (stack.length > 0) {
    var top = stack[stack.length-1];
Severity: Minor
Found in sandbox/grouping/examples/sawire/xml/xpath.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

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

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

             for(var i = 0 ; i < wires.length ; i++) {
                var wire = wires[i];
                if(wire.tgt.moduleId == moduleId) {
                   var paramName = wire.tgt.terminal;
                   var paramValue = this.execValues[wire.src.moduleId][wire.src.terminal];
    Severity: Major
    Found in sandbox/grouping/examples/sawire/ExecutionFrame.js and 2 other locations - About 4 hrs to fix
    sandbox/grouping/examples/sawire/ExecutionFrame.js on lines 455..462
    sandbox/jsBox/ExecutionFrame.js on lines 229..236

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

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

              for(var i = 0 ; i < wires.length ; i++) {
                 var wire = wires[i];
                 if(wire.tgt.moduleId == moduleId) {
                    var paramName = wire.tgt.terminal;
                    var paramValue = this.execValues[wire.src.moduleId][wire.src.terminal];
    Severity: Major
    Found in sandbox/grouping/examples/sawire/ExecutionFrame.js and 2 other locations - About 4 hrs to fix
    sandbox/grouping/examples/sawire/ExecutionFrame.js on lines 505..512
    sandbox/jsBox/ExecutionFrame.js on lines 229..236

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

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

             for(var i = 0 ; i < wires.length ; i++) {
                var wire = wires[i];
                if(wire.tgt.moduleId == moduleId) {
                   var paramName = wire.tgt.terminal;
                   var paramValue = this.execValues[wire.src.moduleId][wire.src.terminal];
    Severity: Major
    Found in sandbox/jsBox/ExecutionFrame.js and 2 other locations - About 4 hrs to fix
    sandbox/grouping/examples/sawire/ExecutionFrame.js on lines 455..462
    sandbox/grouping/examples/sawire/ExecutionFrame.js on lines 505..512

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

    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

        generateFreshName : function(name, usedNames)
        {
            var used = function(name)
                {
                    return Y.Lang.isValue(usedNames[name]);
    Severity: Major
    Found in sandbox/grouping/js/GroupUtils.js and 1 other location - About 4 hrs to fix
    sandbox/grouping/js/GroupUtils.js on lines 991..1016

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

    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

        generateNextName: function(name, usedNames)
        {
            var used = function(name)
                {
                    return Y.Lang.isValue(usedNames[name]);
    Severity: Major
    Found in sandbox/grouping/js/GroupUtils.js and 1 other location - About 4 hrs to fix
    sandbox/grouping/js/GroupUtils.js on lines 809..834

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

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

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

              for (var fName in c.fields)
              {
                  var f = c.fields[fName];
                  var o = {}
                  o.visible = f.visible.checked;
      Severity: Major
      Found in sandbox/grouping/js/GroupUtils.js and 1 other location - About 3 hrs to fix
      sandbox/grouping/js/GroupUtils.js on lines 372..383

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

      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

              for (var fName in g.fields)
              {
                  var f = g.fields[fName];
                  var o = {}
                  o.visible = f.visible.checked;
      Severity: Major
      Found in sandbox/grouping/js/GroupUtils.js and 1 other location - About 3 hrs to fix
      sandbox/grouping/js/GroupUtils.js on lines 335..346

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

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

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

              for (var i = 0; i < this.predicate.length; ++i) {
                var nodes0 = nodes;
                nodes = [];
                for (var j = 0; j < nodes0.length; ++j) {
                  var n = nodes0[j];
            Severity: Major
            Found in sandbox/grouping/examples/sawire/xml/xpath.js and 1 other location - About 3 hrs to fix
            sandbox/grouping/examples/sawire/xml/xpath.js on lines 828..837

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

            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

              for (var i = 0; i < this.predicate.length; ++i) {
                var nodelist0 = nodelist;
                nodelist = [];
                for (var ii = 0; ii < nodelist0.length; ++ii) {
                  var n = nodelist0[ii];
            Severity: Major
            Found in sandbox/grouping/examples/sawire/xml/xpath.js and 1 other location - About 3 hrs to fix
            sandbox/grouping/examples/sawire/xml/xpath.js on lines 1299..1308

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

            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 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
              Severity
              Category
              Status
              Source
              Language