neyric/wireit

View on GitHub

Showing 497 of 497 total issues

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

   Y.LayerTab = function() {
      Y.LayerTab.superclass.constructor.apply(this, arguments);
      
      this.after('render', this.renderLayer, this, true);
   };
Severity: Major
Found in sandbox/yide/tabs/layerTab.js and 2 other locations - About 1 hr to fix
sandbox/yide/tabs/chartsTab.js on lines 7..11
sandbox/yide/tabs/organizationTab.js on lines 7..11

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

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.OrganizationTab = function() {
      Y.OrganizationTab.superclass.constructor.apply(this, arguments);
      
      this.after('render', this.renderTreeview, this, true);
   };
Severity: Major
Found in sandbox/yide/tabs/organizationTab.js and 2 other locations - About 1 hr to fix
sandbox/yide/tabs/chartsTab.js on lines 7..11
sandbox/yide/tabs/layerTab.js on lines 7..11

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

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

       var min=[ Math.min(p1[0],p2[0])-margin[0],
        Math.min(p1[1],p2[1])-margin[1]];
sandbox/wireit-rightsquarearrow-wire/wireit-rightsquarearrow-wire.js on lines 41..41

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

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

    var horizontalMax = Math.max(Y.GroupUtils.valueOr(terminals["top"], []).length, Y.GroupUtils.valueOr(terminals["bottom"], []).length);
Severity: Major
Found in sandbox/grouping/js/GroupFormContainer.js and 1 other location - About 1 hr to fix
sandbox/grouping/js/GroupFormContainer.js on lines 82..82

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

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

    var verticalMax = Math.max(Y.GroupUtils.valueOr(terminals["left"], []).length, Y.GroupUtils.valueOr(terminals["right"], []).length);
Severity: Major
Found in sandbox/grouping/js/GroupFormContainer.js and 1 other location - About 1 hr to fix
sandbox/grouping/js/GroupFormContainer.js on lines 81..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 60.

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 Xml has 31 lines of code (exceeds 25 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 1 hr to fix

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

       draw: function() {
          var margin = [4,4];
    
          // Get the positions of the terminals
          var p1 = this.terminal1.getXY();
    Severity: Minor
    Found in sandbox/wireit-step-wire/wireit-step-wire.js - About 1 hr to fix

      Function getAndCheckOverrides has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          getAndCheckOverrides: function(containerUIMap, groupUIMap)
          {
              var tempGroup = {};
              Y.mix(tempGroup, this);
              tempGroup.containers = [];
      Severity: Minor
      Found in sandbox/grouping/js/Group.js - About 1 hr to fix

        Function replaceChild has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        XNode.prototype.replaceChild = function(newNode, oldNode) {
          if (oldNode == newNode) {
            return;
          }
        
        
        Severity: Minor
        Found in sandbox/grouping/examples/sawire/xml/dom.js - About 1 hr to fix

          Function setupWidget has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

             setupWidget: function(displayDiv) {
              
                  this.display = {};
                  this.display.mainDiv = displayDiv;
                  
          Severity: Minor
          Found in sandbox/grouping/js/Grouper.js - About 1 hr to fix

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

                     for(var key in module.value) {
                        if(module.value.hasOwnProperty(key)) {
                           params[key] = module.value[key];
                        }
                     }
            Severity: Major
            Found in sandbox/grouping/examples/sawire/ExecutionFrame.js and 1 other location - About 1 hr to fix
            sandbox/jsBox/ExecutionFrame.js on lines 222..226

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

            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

                var keywords =    'ascent azimuth background-attachment background-color background-image background-position ' +
                                'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
                                'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
                                'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
                                'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
            Severity: Major
            Found in sandbox/res/SyntaxHighlighter/shBrushCss.js and 1 other location - About 1 hr to fix
            sandbox/res/SyntaxHighlighter/shBrushCss.js on lines 57..70

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

            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

                     for(var key in module.value) {
                        if(module.value.hasOwnProperty(key)) {
                           params[key] = module.value[key];
                        }
                     }
            Severity: Major
            Found in sandbox/jsBox/ExecutionFrame.js and 1 other location - About 1 hr to fix
            sandbox/grouping/examples/sawire/ExecutionFrame.js on lines 498..502

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

            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

                    wireObj.tgt = {moduleId: Y.Array.indexOf(this.layer.containers, wire.terminal2.container), terminal: wire.terminal2.name };
            Severity: Major
            Found in sandbox/editor/editor.js and 1 other location - About 1 hr to fix
            sandbox/editor/editor.js on lines 546..546

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

            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

                var values =    'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
                                'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
                                'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+
                                'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
                                'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
            Severity: Major
            Found in sandbox/res/SyntaxHighlighter/shBrushCss.js and 1 other location - About 1 hr to fix
            sandbox/res/SyntaxHighlighter/shBrushCss.js on lines 42..55

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

            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

                    wireObj.src = {moduleId: Y.Array.indexOf(this.layer.containers, wire.terminal1.container), terminal: wire.terminal1.name };
            Severity: Major
            Found in sandbox/editor/editor.js and 1 other location - About 1 hr to fix
            sandbox/editor/editor.js on lines 547..547

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

            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 (!Y.Lang.isValue(index))
                    index = Y.GroupUtils.firstTestSucess(this.containers, function (co) { return co.container == container; });
            Severity: Major
            Found in sandbox/grouping/js/Group.js and 1 other location - About 1 hr to fix
            sandbox/grouping/js/Group.js on lines 198..199

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

            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 (!Y.Lang.isValue(index))
                    index = Y.GroupUtils.firstTestSucess(this.groups, function (go) { return go.group == group });
            Severity: Major
            Found in sandbox/grouping/js/Group.js and 1 other location - About 1 hr to fix
            sandbox/grouping/js/Group.js on lines 184..185

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

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

            Y.Layer.prototype.clearExplode = function(callback, bind) {
            
               var center = [ Math.floor(Y.DOM.viewportRegion().width/2),
                                Math.floor(Y.DOM.viewportRegion().height/2)];
               var R = 1.2*Math.sqrt( Math.pow(center[0],2)+Math.pow(center[1],2));
            Severity: Minor
            Found in sandbox/clearExplode.js - About 1 hr to fix

              Function deserialise has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var deserialise = function(sGroup, groupToSet)
                  {
                      var group = groupToSet;
                      if (!Y.Lang.isValue(group))
                      group = new Y.Group(this.group.grouper, this.layer)
              Severity: Minor
              Found in sandbox/grouping/js/GroupFormContainer.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language