neyric/wireit

View on GitHub

Showing 497 of 497 total issues

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

        "terminals": [
        {
            "name": "out",
            "direction": [0, 1],
            "offsetPosition": {
Severity: Major
Found in sandbox/grouping/examples/sawire/modules.js and 3 other locations - About 1 hr to fix
sandbox/composable-editor/composable-editor.js on lines 31..37
sandbox/grouping/examples/sawire/modules.js on lines 152..165
sandbox/grouping/examples/sawire/modules.js on lines 186..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 57.

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

            {
                name: "Lightbulb",
                config : {
                    type: "Lightbulb", 
                    imageUrl: "images/lightbulb_off.png",
Severity: Major
Found in app-examples/logic-gates/logic-gates.js and 2 other locations - About 1 hr to fix
app-examples/logic-gates/logic-gates.js on lines 80..89
app-examples/logic-gates/logic-gates.js on lines 90..99

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

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

            {
                name: "Clock",
                config : {
                    type: "ClockContainer", 
                    imageUrl: "images/clock_off.png",
Severity: Major
Found in app-examples/logic-gates/logic-gates.js and 2 other locations - About 1 hr to fix
app-examples/logic-gates/logic-gates.js on lines 70..79
app-examples/logic-gates/logic-gates.js on lines 80..89

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

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

        "terminals": [
        {
            "name": "out",
            "direction": [0, 1],
            "offsetPosition": {
Severity: Major
Found in sandbox/grouping/examples/sawire/modules.js and 3 other locations - About 1 hr to fix
sandbox/composable-editor/composable-editor.js on lines 31..37
sandbox/grouping/examples/sawire/modules.js on lines 108..121
sandbox/grouping/examples/sawire/modules.js on lines 186..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 57.

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

        "terminals": [
        {
            "name": "out",
            "direction": [0, 1],
            "offsetPosition": {
Severity: Major
Found in sandbox/grouping/examples/sawire/modules.js and 3 other locations - About 1 hr to fix
sandbox/composable-editor/composable-editor.js on lines 31..37
sandbox/grouping/examples/sawire/modules.js on lines 108..121
sandbox/grouping/examples/sawire/modules.js on lines 152..165

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

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

            {
                name: "Switch",
                config : {
                    type:"Switch", 
                    imageUrl: "images/switch_off.png",
Severity: Major
Found in app-examples/logic-gates/logic-gates.js and 2 other locations - About 1 hr to fix
app-examples/logic-gates/logic-gates.js on lines 70..79
app-examples/logic-gates/logic-gates.js on lines 90..99

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

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 id has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  'id': function(ctx) {
    assert(this.args.length == 1);
    var e = this.args[0].evaluate(ctx);
    var ret = [];
    var ids;
Severity: Minor
Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 1 hr 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 xsltPassThrough has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function xsltPassThrough(input, template, output, outputDocument) {
  if (template.nodeType == DOM_TEXT_NODE) {
    if (xsltPassText(template)) {
      var node = domCreateTextNode(outputDocument, template.nodeValue);
      domAppendChild(output, node);
Severity: Minor
Found in sandbox/grouping/examples/sawire/xml/xslt.js - About 1 hr 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 xmlValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function xmlValue(node) {
  if (!node) {
    return '';
  }

Severity: Minor
Found in sandbox/grouping/examples/sawire/xml/util.js - About 1 hr 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 createTerminals has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

   createTerminals: function() {
      
      // Output Terminal
      if(!this.outputTerminal) {
          this.outputTerminal = this.addTerminal({xtype: "Y.TerminalOutput", "name": "out"});      
Severity: Minor
Found in sandbox/jsBox/jsBox.js - About 1 hr 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 createTerminals has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

   createTerminals: function() {
      
      // Output Terminal
      if(!this.outputTerminal) {
        this.outputTerminal = this.addTerminal({xtype: "Y.TerminalOutput", "name": "out"});
Severity: Minor
Found in sandbox/grouping/examples/sawire/containers/jsrunner.js - About 1 hr 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 xsltPassText has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function xsltPassText(template) {
  if (!template.nodeValue.match(/^\s*$/)) {
    return true;
  }

Severity: Minor
Found in sandbox/grouping/examples/sawire/xml/xslt.js - About 1 hr 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 setWiring has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

   setWiring: function (wiring) {
      
      var that = this,
          layer = this.layer;

Severity: Minor
Found in src/wireit-app/js/editor-view.js - About 1 hr to fix

    Function RubberBand has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Y.RubberBand = function(grouper) {
        
        Y.RubberBand.superclass.constructor.call(this, grouper.layer.el);
        
        this.grouper = grouper;
    Severity: Minor
    Found in sandbox/grouping/js/RubberBand.js - About 1 hr to fix

      Function setWiring has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

         setWiring: function (wiring) {
            
            var that = this,
                layer = this.layer;
      
      
      Severity: Minor
      Found in build/wireit-all/wireit-all-debug.js - About 1 hr to fix

        Function setWiring has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

           setWiring: function (wiring) {
              
              var that = this,
                  layer = this.layer;
        
        
        Severity: Minor
        Found in build/wireit-app/wireit-app.js - About 1 hr to fix

          Function setWiring has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

             setWiring: function (wiring) {
                
                var that = this,
                    layer = this.layer;
          
          
          Severity: Minor
          Found in build/wireit-app/wireit-app-debug.js - About 1 hr to fix

            Function setWiring has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

               setWiring: function (wiring) {
                  
                  var that = this,
                      layer = this.layer;
            
            
            Severity: Minor
            Found in build/wireit-all/wireit-all.js - About 1 hr to fix

              Function ComposedContainer has 26 lines of code (exceeds 25 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 1 hr to fix

                Function mergeFieldOverrides has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    mergeFieldOverrides : function(fieldConfigs, overrides, usedNames, forceVisible, fieldMap)
                    {
                        for (var fI in fieldConfigs)
                        {
                        var f = fieldConfigs[fI];
                Severity: Minor
                Found in sandbox/grouping/js/GroupUtils.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language