neyric/wireit

View on GitHub

Showing 497 of 497 total issues

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

    } else if (v2.type == 'number') {
      var n = v1.nodeSetValue();
      var s = v2.numberValue();

      ret = false;
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 1418..1472

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

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 (v1.type == 'number') {
      var s = v1.numberValue();
      var n = v2.nodeSetValue();

      ret = false;
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 1431..1472

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

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

    propertiesFields: [
        // default fields (the "name" field is required by the WiringEditor):
        {"type": "string", "name": "name", label: "Title", typeInvite: "Enter a title" },
        {"type": "text", "name": "description", label: "Description", cols: 30},
        
Severity: Major
Found in sandbox/editor-examples/WiringEditor/demo.js and 1 other location - About 3 hrs to fix
sandbox/grouping/examples/WiringEditor/embedded.js on lines 97..105

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

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

    propertiesFields: [
        // default fields (the "name" field is required by the WiringEditor):
        {"type": "string", "name": "name", label: "Title", typeInvite: "Enter a title" },
        {"type": "text", "name": "description", label: "Description", cols: 30},
        
Severity: Major
Found in sandbox/grouping/examples/WiringEditor/embedded.js and 1 other location - About 3 hrs to fix
sandbox/editor-examples/WiringEditor/demo.js on lines 7..15

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

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

File util.js has 310 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2005 Google
//
// Author: Steffen Meschkat <mesch@google.com>
//
// Miscellaneous utility and placeholder functions.
Severity: Minor
Found in sandbox/grouping/examples/sawire/xml/util.js - About 3 hrs to fix

    File wireit-app-debug.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    YUI.add('wireit-app', function (Y, NAME) {
    
    
    // -- LocalStorageSync ---------------------------------------------------------------------
    // Saves WiringModel
    Severity: Minor
    Found in build/wireit-app/wireit-app-debug.js - About 3 hrs to fix

      File wireit-app.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      YUI.add('wireit-app', function (Y, NAME) {
      
      
      // -- LocalStorageSync ---------------------------------------------------------------------
      // Saves WiringModel
      Severity: Minor
      Found in build/wireit-app/wireit-app.js - About 3 hrs to fix

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

                 if( m.name == "input") {
                    m.value.input.inputParams.wirable = true;
                    options.fields.push(m.value.input);
                 }
                 else if(m.name == "output") {
        Severity: Major
        Found in sandbox/grouping/examples/sawire/modules.js and 1 other location - About 3 hrs to fix
        sandbox/composed-container/composed-container.js on lines 23..37

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

        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

            } else if (v1.type == 'string') {
              var s = v1.stringValue();
              var n = v2.nodeSetValue();
        
              ret = false;
        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 1457..1472

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

        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

            } else if (v2.type == 'string') {
              var n = v1.nodeSetValue();
              var s = v2.stringValue();
        
              ret = false;
        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 1444..1472

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

        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

                 if( m.name == "input") {
                    m.value.input.wirable = true;
                    options.fields.push(m.value.input);
                 }
                 else if(m.name == "output") {
        Severity: Major
        Found in sandbox/composed-container/composed-container.js and 1 other location - About 3 hrs to fix
        sandbox/grouping/examples/sawire/modules.js on lines 285..299

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

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

        function xpathParse(expr) {
          xpathLog('parse ' + expr);
          xpathParseInit();
        
          var cached = xpathCacheLookup(expr);
        Severity: Major
        Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 3 hrs to fix

          Function execute has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

             execute: function(moduleId,params) {
                
                try {
                   
                
          Severity: Major
          Found in sandbox/jsBox/ExecutionFrame.js - About 3 hrs to fix

            Function xpathMatchStack has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

            function xpathMatchStack(stack, pattern) {
            
              // NOTE(mesch): The stack matches for variable cardinality are
              // greedy but don't do backtracking. This would be an issue only
              // with rules of the form A* A, i.e. with an element with variable
            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 loadLevel has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    loadLevel: function(level) {
            
                       Y.one('#levelContainer').innerHTML = level;
            
                       var c = level+2;
            Severity: Major
            Found in sandbox/planar-game/planar-game.js - About 3 hrs to fix

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

                              {
                                  position:[40,110],
                                  "xtype":"Y.Container", 
                                  title: "input",
                                  width: 100,
              Severity: Major
              Found in sandbox/layer-container/layer-container.js and 1 other location - About 3 hrs to fix
              sandbox/layer-container/layer-container.js on lines 91..100

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

              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

                              {
                                  position:[20,30],
                                  "xtype":"Y.Container", 
                                  title: "input",
                                  width: 100,
              Severity: Major
              Found in sandbox/layer-container/layer-container.js and 1 other location - About 3 hrs to fix
              sandbox/layer-container/layer-container.js on lines 101..110

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

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

                  run: function() {
                      
                      var i, j, l;
                      
                      // Extract nodes positions
              Severity: Major
              Found in sandbox/wireit-layout/wireit-layout.js - About 3 hrs to fix

                Function xmlTextR has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                function xmlTextR(node, buf, cdata) {
                  if (node.nodeType == DOM_TEXT_NODE) {
                    buf.push(xmlEscapeText(node.nodeValue));
                
                  } else if (node.nodeType == DOM_CDATA_SECTION_NODE) {
                Severity: Minor
                Found in sandbox/grouping/examples/sawire/xml/util.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 generateFieldMap has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    generateFieldMap: function(group, usedNames, containerMap, groupMap)
                    {
                        var self = this;
                        
                        var allContainers = [];
                Severity: Major
                Found in sandbox/grouping/js/GroupUtils.js - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language