neyric/wireit

View on GitHub
sandbox/grouping/js/GroupFormContainer.js

Summary

Maintainability
D
2 days
Test Coverage

Function expand has 130 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    expand: function() 
    {
    //For each module add it to the layer
    //For each wire wire up the new containers
    //For each internal group add to layer groups, remap from serialised 
Severity: Major
Found in sandbox/grouping/js/GroupFormContainer.js - About 5 hrs to fix

    Function positionTerminals has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        positionTerminals: function()
        {
        var terminals = {};
        
        for (var i in this.options.terminals)
    Severity: Major
    Found in sandbox/grouping/js/GroupFormContainer.js - About 2 hrs 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

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

                    {
                    wire.src = thisC
                    wire.tgt = {"moduleId" : self.layer.containers.indexOf(w.terminal2.container), "terminal" : w.terminal2.options.name}
                    }
        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 249..252

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

        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

                    {
                    wire.tgt = thisC
                    wire.src = {"moduleId" : self.layer.containers.indexOf(w.terminal1.container), "terminal" : w.terminal1.options.name}            
                    }
        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 244..247

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

        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 (height < getRange(verticalMax))
            {
                this.bodyEl.style.minHeight = new String(getRange(verticalMax)) + "px";
                height = this.el.offsetHeight;
            }
        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 90..94

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

        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 (width < getRange(horizontalMax))
            {
                this.bodyEl.style.minWidth = new String(getRange(horizontalMax)) + "px";
                width = this.el.offsetWidth;
            }
        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 84..88

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

        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

        There are no issues that match your filters.

        Category
        Status