neyric/wireit

View on GitHub
sandbox/editor/editor.js

Summary

Maintainability
D
1 day
Test Coverage

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

        loadPipe: function(name) {
    
            if(!this.isSaved()) {
                if( !confirm("Warning: Your work is not saved yet ! Press ok to continue anyway.") ) {
                    return;
    Severity: Minor
    Found in sandbox/editor/editor.js - About 1 hr to fix

      Function setOptions has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

           setOptions: function(options) {
          
              Y.WireWiringEditor.superclass.setOptions.call(this, options);
          
              // Load the modules from options
      Severity: Minor
      Found in sandbox/editor/editor.js - About 1 hr to fix

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

                    for(var i = 0 ; i < p.length ; i++) {
                        var v = p[i].split('=');
                        oP[v[0]]=window.decodeURIComponent(v[1]);
                    }
        Severity: Major
        Found in sandbox/editor/editor.js and 1 other location - About 1 hr to fix
        sandbox/editor-examples/BPMN-editor/bpmn-2.0.js on lines 1082..1085

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

        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

                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

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

                  this.options.modulesAccordionViewParams = Y.mix({
                                                                collapsible: true, 
                                                                expandable: true, // remove this parameter to open only one panel at a time
                                                                width: 'auto', 
                                                                expandItem: 0, 
        Severity: Minor
        Found in sandbox/editor/editor.js and 1 other location - About 50 mins to fix
        sandbox/editor-base/editor-base.js on lines 48..56

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

        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

                   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

        There are no issues that match your filters.

        Category
        Status