neyric/wireit

View on GitHub

Showing 497 of 497 total issues

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

  for (var a = 0; a < node.attributes.length; ++a) {
    XNode.recycle(node.attributes[a]);
  }
Severity: Minor
Found in sandbox/grouping/examples/sawire/xml/dom.js and 1 other location - About 45 mins to fix
sandbox/grouping/examples/sawire/xml/dom.js on lines 306..308

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

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 c = 0; c < node.childNodes.length; ++c) {
    XNode.recycle(node.childNodes[c]);
  }
Severity: Minor
Found in sandbox/grouping/examples/sawire/xml/dom.js and 1 other location - About 45 mins to fix
sandbox/grouping/examples/sawire/xml/dom.js on lines 303..305

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

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

Y.LeftSquareArrow = function( terminal1, terminal2, parentEl, options) {
    Y.LeftSquareArrow.superclass.constructor.call(this, terminal1, terminal2, parentEl, options);
};
sandbox/wireit-rightsquarearrow-wire/wireit-rightsquarearrow-wire.js on lines 14..16
sandbox/wireit-step-wire/wireit-step-wire.js on lines 15..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 49.

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

Y.StepWire = function( terminal1, terminal2, parentEl, options) {
    Y.StepWire.superclass.constructor.call(this, terminal1, terminal2, parentEl, options);
};
Severity: Major
Found in sandbox/wireit-step-wire/wireit-step-wire.js and 2 other locations - About 40 mins to fix
sandbox/wireit-leftsquarearrow-wire/wireit-leftsquarearrow-wire.js on lines 14..16
sandbox/wireit-rightsquarearrow-wire/wireit-rightsquarearrow-wire.js on lines 14..16

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

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

Y.RightSquareArrow = function( terminal1, terminal2, parentEl, options) {
    Y.RightSquareArrow.superclass.constructor.call(this, terminal1, terminal2, parentEl, options);
};
sandbox/wireit-leftsquarearrow-wire/wireit-leftsquarearrow-wire.js on lines 14..16
sandbox/wireit-step-wire/wireit-step-wire.js on lines 15..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 49.

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

Consider simplifying this complex logical expression.
Open

  if (expr.steps && !expr.absolute && expr.steps.length == 1 &&
      expr.steps[0].axis == 'child' && expr.steps[0].predicate.length == 0) {
    ret = expr.steps[0].nodetest.evaluate(context).booleanValue();

  } else {
Severity: Major
Found in sandbox/grouping/examples/sawire/xml/xslt.js - About 40 mins to fix

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

                       Y.Array.each(this.getConnected(), function(b) {
                          b.get('boundingBox').addClass('connected-to-dragged');
                       });
    Severity: Minor
    Found in sandbox/planar-game/planar-game.js and 1 other location - About 40 mins to fix
    sandbox/planar-game/planar-game.js on lines 134..136

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

    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

                      Y.Array.each(this.getConnected(), function(b) {
                          b.get('boundingBox').removeClass('connected-to-dragged');
                       });
    Severity: Minor
    Found in sandbox/planar-game/planar-game.js and 1 other location - About 40 mins to fix
    sandbox/planar-game/planar-game.js on lines 128..130

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

    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 makeFunctionCallExpr2 has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function makeFunctionCallExpr2(name, pareno, arg1, args, parenc) {
    Severity: Minor
    Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 35 mins to fix

      Function DD has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      Y.LayerContainer.DD = function( terminals, subLayer, id, sGroup, config) {
      Severity: Minor
      Found in sandbox/layer-container/layer-container.js - About 35 mins to fix

        Function mergeTerminalOverrides has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                var mergeTerminalOverrides = function(terminalConfigs, overrides, usedNames, forceVisible, terminalMap)
        Severity: Minor
        Found in sandbox/grouping/js/GroupUtils.js - About 35 mins to fix

          Function xPathStep has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function xPathStep(nodes, steps, step, input, ctx) {
          Severity: Minor
          Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 35 mins to fix

            Function addControls has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    var addControls = function (fieldsAndTerminals, overrides, results, showOnByIndex, showOffByIndex)
            Severity: Minor
            Found in sandbox/grouping/js/Group.js - About 35 mins to fix

              Function mergeFieldOverrides has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  mergeFieldOverrides : function(fieldConfigs, overrides, usedNames, forceVisible, fieldMap)
              Severity: Minor
              Found in sandbox/grouping/js/GroupUtils.js - About 35 mins to fix

                Function lang has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  'lang': function(ctx) {
                    assert(this.args.length == 1);
                    var lang = this.args[0].evaluate(ctx).stringValue();
                    var xmllang;
                    var n = ctx.node;
                Severity: Minor
                Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 35 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 executeModules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                   executeModules: function(moduleId, srcTerminal) {
                      
                         //console.log("executeModules", moduleId, srcTerminal);
                         var params = this.execValues[moduleId][srcTerminal];
                      
                Severity: Minor
                Found in sandbox/grouping/examples/sawire/ExecutionFrame.js - About 35 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 ComposedContainer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                jsBox.ComposedContainer = function(options, layer) {
                   
                   if(!options.fields) {
                      
                      options.fields = [];
                Severity: Minor
                Found in sandbox/grouping/examples/sawire/modules.js - About 35 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 Xml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                SyntaxHighlighter.brushes.Xml = function()
                {
                    function process(match, regexInfo)
                    {
                        var constructor = SyntaxHighlighter.Match,
                Severity: Minor
                Found in sandbox/res/SyntaxHighlighter/shBrushXml.js - About 35 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 executeModules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                   executeModules: function(moduleId, srcTerminal) {
                      
                         //console.log("executeModules", moduleId, srcTerminal);
                         var params = this.execValues[moduleId][srcTerminal];
                      
                Severity: Minor
                Found in sandbox/jsBox/ExecutionFrame.js - About 35 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

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

                           this.loadPanel = new Y.Panel('WiringEditor-loadPanel', {
                              fixedcenter: true,
                              draggable: true,
                              width: '500px',
                              visible: false,
                Severity: Minor
                Found in sandbox/editor/editor.js and 1 other location - About 35 mins to fix
                sandbox/editor-base/editor-base.js on lines 131..137

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

                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