juanmard/icestudio

View on GitHub
services/blocks.js

Summary

Maintainability
F
1 mo
Test Coverage

File blocks.js has 1613 lines of code (exceeds 250 allowed). Consider refactoring.
Open

angular
  .module('icestudio')
  .service('blocks', function ($log, joint, utils, common, gettextCatalog) {
    'use strict';

Severity: Major
Found in services/blocks.js - About 4 days to fix

    Function newBasicCode has 186 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function newBasicCode(callback, block) {
          var blockInstance = {
            id: null,
            data: {
              code: '',
    Severity: Major
    Found in services/blocks.js - About 7 hrs to fix

      Function editBasicOutputLabel has 104 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function editBasicOutputLabel(cellView, callback) {
            var graph = cellView.paper.model;
            var block = cellView.model.attributes;
            var formSpecs = [
              {
      Severity: Major
      Found in services/blocks.js - About 4 hrs to fix

        Function editBasicInput has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function editBasicInput(cellView, callback) {
              var graph = cellView.paper.model;
              var block = cellView.model.attributes;
              var formSpecs = [
                {
        Severity: Major
        Found in services/blocks.js - About 4 hrs to fix

          Function editBasicInputLabel has 93 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function editBasicInputLabel(cellView, callback) {
                var graph = cellView.paper.model;
                var block = cellView.model.attributes;
                var formSpecs = [
                  {
          Severity: Major
          Found in services/blocks.js - About 3 hrs to fix

            Function editBasicOutput has 85 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function editBasicOutput(cellView, callback) {
                  var graph = cellView.paper.model;
                  var block = cellView.model.attributes;
                  var formSpecs = [
                    {
            Severity: Major
            Found in services/blocks.js - About 3 hrs to fix

              Function newBasicInput has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function newBasicInput(callback) {
                    var blockInstance = {
                      id: null,
                      data: {},
                      type: 'basic.input',
              Severity: Major
              Found in services/blocks.js - About 3 hrs to fix

                Function newBasicOutputLabel has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function newBasicOutputLabel(callback) {
                      var blockInstance = {
                        id: null,
                        data: {},
                        type: 'basic.outputLabel',
                Severity: Major
                Found in services/blocks.js - About 2 hrs to fix

                  Function newBasicMemory has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function newBasicMemory(callback) {
                        var blockInstance = {
                          id: null,
                          data: {},
                          type: 'basic.memory',
                  Severity: Major
                  Found in services/blocks.js - About 2 hrs to fix

                    Function loadGeneric has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function loadGeneric(instance, block, disabled) {
                          var i;
                          var leftPorts = [];
                          var rightPorts = [];
                          var topPorts = [];
                    Severity: Major
                    Found in services/blocks.js - About 2 hrs to fix

                      Function newBasicInputLabel has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function newBasicInputLabel(callback) {
                            var blockInstance = {
                              id: null,
                              data: {},
                              type: 'basic.inputLabel',
                      Severity: Major
                      Found in services/blocks.js - About 2 hrs to fix

                        Function newBasicOutput has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function newBasicOutput(callback) {
                              var blockInstance = {
                                id: null,
                                data: {},
                                type: 'basic.output',
                        Severity: Major
                        Found in services/blocks.js - About 2 hrs to fix

                          Function editBasicMemory has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function editBasicMemory(cellView) {
                                var block = cellView.model.attributes;
                                var formSpecs = [
                                  {
                                    type: 'text',
                          Severity: Major
                          Found in services/blocks.js - About 2 hrs to fix

                            Function newBasicConstant has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function newBasicConstant(callback) {
                                  var blockInstance = {
                                    id: null,
                                    data: {},
                                    type: 'basic.constant',
                            Severity: Major
                            Found in services/blocks.js - About 2 hrs to fix

                              Consider simplifying this complex logical expression.
                              Open

                                            if (
                                              (source.id === cell.id &&
                                                containsPort(source.port, size, cell.get('rightPorts'))) ||
                                              (target.id === cell.id &&
                                                containsPort(target.port, size, cell.get('leftPorts')) &&
                              Severity: Critical
                              Found in services/blocks.js - About 2 hrs to fix

                                Function loadBasicCode has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function loadBasicCode(instance, disabled) {
                                      var port;
                                      var leftPorts = [];
                                      var rightPorts = [];
                                      var topPorts = [];
                                Severity: Minor
                                Found in services/blocks.js - About 1 hr to fix

                                  Function editBasicCode has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function editBasicCode(cellView, callback) {
                                        var graph = cellView.paper.model;
                                        var block = cellView.model.attributes;
                                        var blockInstance = {
                                          id: block.id,
                                  Severity: Minor
                                  Found in services/blocks.js - About 1 hr to fix

                                    Function editBasicConstant has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function editBasicConstant(cellView) {
                                          var block = cellView.model.attributes;
                                          var formSpecs = [
                                            {
                                              type: 'text',
                                    Severity: Minor
                                    Found in services/blocks.js - About 1 hr to fix

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

                                          function loadWire(instance, source, target) {
                                            // Find selectors
                                            var sourceSelector, targetSelector;
                                            var leftPorts = target.get('leftPorts');
                                            var rightPorts = source.get('rightPorts');
                                      Severity: Minor
                                      Found in services/blocks.js - About 1 hr to fix

                                        Function editBasic has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            function editBasic(type, cellView, callback) {
                                              switch (type) {
                                                case 'basic.input':
                                                  editBasicInput(cellView, callback);
                                                  break;
                                        Severity: Minor
                                        Found in services/blocks.js - About 1 hr to fix

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

                                              function newGeneric(type, block, callback) {
                                                var blockInstance = {
                                                  id: null,
                                                  type: type,
                                                  position: {x: 0, y: 0},
                                          Severity: Minor
                                          Found in services/blocks.js - About 1 hr to fix

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

                                                      if ((block.data.range || '') !== (portInfo.rangestr || '')) {
                                                        var pins = getPins(portInfo);
                                                        oldSize = block.data.pins ? block.data.pins.length : 1;
                                                        oldSize = block.data.virtual ? 1 : oldSize;
                                                        newSize = virtual ? 1 : pins ? pins.length : 1;
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 day to fix
                                            services/blocks.js on lines 1182..1240

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

                                            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 ((block.data.range || '') !== (portInfo.rangestr || '')) {
                                                        var pins = getPins(portInfo);
                                                        oldSize = block.data.pins ? block.data.pins.length : 1;
                                                        oldSize = block.data.virtual ? 1 : oldSize;
                                                        newSize = virtual ? 1 : pins ? pins.length : 1;
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 day to fix
                                            services/blocks.js on lines 1395..1450

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

                                            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 ((block.data.range || '') !== (portInfo.rangestr || '')) {
                                                        var pins = getPins(portInfo);
                                                        oldSize = block.data.pins ? block.data.pins.length : 1;
                                                        oldSize = block.data.virtual ? 1 : oldSize;
                                                        newSize = virtual ? 1 : pins ? pins.length : 1;
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 day to fix
                                            services/blocks.js on lines 1491..1543

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

                                            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 ((block.data.range || '') !== (portInfo.rangestr || '')) {
                                                        var pins = getPins(portInfo);
                                                        oldSize = block.data.pins ? block.data.pins.length : 1;
                                                        oldSize = block.data.virtual ? 1 : oldSize;
                                                        newSize = virtual ? 1 : pins ? pins.length : 1;
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 day to fix
                                            services/blocks.js on lines 1286..1341

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

                                            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

                                                function loadBasicInput(instance, disabled) {
                                                  var data = instance.data;
                                                  var rightPorts = [
                                                    {
                                                      id: 'out',
                                            Severity: Major
                                            Found in services/blocks.js and 2 other locations - About 6 hrs to fix
                                            services/blocks.js on lines 815..836
                                            services/blocks.js on lines 838..858

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

                                            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

                                                function loadBasicOutput(instance, disabled) {
                                                  var data = instance.data;
                                                  var leftPorts = [
                                                    {
                                                      id: 'in',
                                            Severity: Major
                                            Found in services/blocks.js and 2 other locations - About 6 hrs to fix
                                            services/blocks.js on lines 791..813
                                            services/blocks.js on lines 815..836

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

                                            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

                                                function loadBasicOutputLabel(instance, disabled) {
                                                  var data = instance.data;
                                                  var rightPorts = [
                                                    {
                                                      id: 'outlabel',
                                            Severity: Major
                                            Found in services/blocks.js and 2 other locations - About 6 hrs to fix
                                            services/blocks.js on lines 791..813
                                            services/blocks.js on lines 838..858

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

                                            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

                                                    for (i in inPorts) {
                                                      if (inPorts[i]) {
                                                        inPortInfo = utils.parsePortLabel(
                                                          inPorts[i],
                                                          common.PATTERN_PORT_LABEL
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 5 hrs to fix
                                            services/blocks.js on lines 620..641

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

                                            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

                                                    for (o in outPorts) {
                                                      if (outPorts[o]) {
                                                        outPortInfo = utils.parsePortLabel(
                                                          outPorts[o],
                                                          common.PATTERN_PORT_LABEL
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 5 hrs to fix
                                            services/blocks.js on lines 594..615

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

                                            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

                                                    for (i in inPortInfos) {
                                                      if (inPortInfos[i]) {
                                                        pins = getPins(inPortInfos[i]);
                                                        blockInstance.data.ports.in.push({
                                                          name: inPortInfos[i].name,
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 4 hrs to fix
                                            services/blocks.js on lines 688..698

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

                                            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

                                                    for (o in outPortInfos) {
                                                      if (outPortInfos[o]) {
                                                        pins = getPins(outPortInfos[o]);
                                                        blockInstance.data.ports.out.push({
                                                          name: outPortInfos[o].name,
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 4 hrs to fix
                                            services/blocks.js on lines 676..686

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

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

                                                    for (var l in labels) {
                                                      portInfo = utils.parsePortLabel(
                                                        labels[l],
                                                        common.PATTERN_GLOBAL_PORT_LABEL
                                                      );
                                            Severity: Major
                                            Found in services/blocks.js and 5 other locations - About 3 hrs to fix
                                            services/blocks.js on lines 184..201
                                            services/blocks.js on lines 260..277
                                            services/blocks.js on lines 330..347
                                            services/blocks.js on lines 411..428
                                            services/blocks.js on lines 487..504

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

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

                                                    for (var l in labels) {
                                                      paramInfo = utils.parseParamLabel(
                                                        labels[l],
                                                        common.PATTERN_GLOBAL_PARAM_LABEL
                                                      );
                                            Severity: Major
                                            Found in services/blocks.js and 5 other locations - About 3 hrs to fix
                                            services/blocks.js on lines 101..118
                                            services/blocks.js on lines 184..201
                                            services/blocks.js on lines 260..277
                                            services/blocks.js on lines 330..347
                                            services/blocks.js on lines 411..428

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

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

                                                    for (var l in labels) {
                                                      portInfo = utils.parsePortLabel(
                                                        labels[l],
                                                        common.PATTERN_GLOBAL_PORT_LABEL
                                                      );
                                            Severity: Major
                                            Found in services/blocks.js and 5 other locations - About 3 hrs to fix
                                            services/blocks.js on lines 101..118
                                            services/blocks.js on lines 184..201
                                            services/blocks.js on lines 330..347
                                            services/blocks.js on lines 411..428
                                            services/blocks.js on lines 487..504

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

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

                                                    for (var l in labels) {
                                                      paramInfo = utils.parseParamLabel(
                                                        labels[l],
                                                        common.PATTERN_GLOBAL_PARAM_LABEL
                                                      );
                                            Severity: Major
                                            Found in services/blocks.js and 5 other locations - About 3 hrs to fix
                                            services/blocks.js on lines 101..118
                                            services/blocks.js on lines 184..201
                                            services/blocks.js on lines 260..277
                                            services/blocks.js on lines 330..347
                                            services/blocks.js on lines 487..504

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

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

                                                    for (var l in labels) {
                                                      portInfo = utils.parsePortLabel(
                                                        labels[l],
                                                        common.PATTERN_GLOBAL_PORT_LABEL
                                                      );
                                            Severity: Major
                                            Found in services/blocks.js and 5 other locations - About 3 hrs to fix
                                            services/blocks.js on lines 101..118
                                            services/blocks.js on lines 260..277
                                            services/blocks.js on lines 330..347
                                            services/blocks.js on lines 411..428
                                            services/blocks.js on lines 487..504

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

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

                                                    for (var l in labels) {
                                                      portInfo = utils.parsePortLabel(
                                                        labels[l],
                                                        common.PATTERN_GLOBAL_PORT_LABEL
                                                      );
                                            Severity: Major
                                            Found in services/blocks.js and 5 other locations - About 3 hrs to fix
                                            services/blocks.js on lines 101..118
                                            services/blocks.js on lines 184..201
                                            services/blocks.js on lines 260..277
                                            services/blocks.js on lines 411..428
                                            services/blocks.js on lines 487..504

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

                                            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 formSpecs = [
                                                    {
                                                      type: 'text',
                                                      title: _tcStr('Update the block name'),
                                                      value: block.data.name + (block.data.range || ''),
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 3 hrs to fix
                                            services/blocks.js on lines 1253..1268

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

                                            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 formSpecs = [
                                                    {
                                                      type: 'text',
                                                      title: _tcStr('Update the block name'),
                                                      value: block.data.name + (block.data.range || ''),
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 3 hrs to fix
                                            services/blocks.js on lines 1141..1156

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

                                            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

                                                      for (index in block.data.ports.in) {
                                                        port = block.data.ports.in[index];
                                                        inPorts.push(port.name + (port.range || ''));
                                                      }
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 hr to fix
                                            services/blocks.js on lines 548..551

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

                                            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

                                                      for (index in block.data.ports.out) {
                                                        port = block.data.ports.out[index];
                                                        outPorts.push(port.name + (port.range || ''));
                                                      }
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 hr to fix
                                            services/blocks.js on lines 542..545

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

                                            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

                                                    leftPorts.push({
                                                      id: port.name,
                                                      name: port.name,
                                                      label: port.name + (port.range || ''),
                                                      size: port.size || 1,
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 hr to fix
                                            services/blocks.js on lines 944..949

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

                                            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

                                                    rightPorts.push({
                                                      id: port.name,
                                                      name: port.name,
                                                      label: port.name + (port.range || ''),
                                                      size: port.size || 1,
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 hr to fix
                                            services/blocks.js on lines 934..939

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

                                            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

                                                  for (var _out = 0; _out < rightPorts.length; _out++) {
                                                    if (rightPorts[_out] === instance.source.port) {
                                                      sourceSelector = _out;
                                                      break;
                                                    }
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 hr to fix
                                            services/blocks.js on lines 1081..1086

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

                                            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

                                                  for (var _in = 0; _in < leftPorts.length; _in++) {
                                                    if (leftPorts[_in] === instance.target.port) {
                                                      targetSelector = _in;
                                                      break;
                                                    }
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 hr to fix
                                            services/blocks.js on lines 1075..1080

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

                                            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 formSpecs = [
                                                    {
                                                      type: 'text',
                                                      title: _tcStr('Enter the output blocks'),
                                                      value: '',
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 hr to fix
                                            services/blocks.js on lines 77..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 55.

                                            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 formSpecs = [
                                                    {
                                                      type: 'text',
                                                      title: _tcStr('Enter the input blocks'),
                                                      value: '',
                                            Severity: Major
                                            Found in services/blocks.js and 1 other location - About 1 hr to fix
                                            services/blocks.js on lines 307..319

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

                                            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

                                                      options: [
                                                        {value: 2, label: _tcStr('Binary')},
                                                        {value: 10, label: _tcStr('Decimal')},
                                                        {value: 16, label: _tcStr('Hexadecimal')},
                                                      ],
                                            Severity: Minor
                                            Found in services/blocks.js and 1 other location - About 55 mins to fix
                                            services/blocks.js on lines 465..469

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

                                            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

                                                      options: [
                                                        {value: 2, label: _tcStr('Binary')},
                                                        {value: 10, label: _tcStr('Decimal')},
                                                        {value: 16, label: _tcStr('Hexadecimal')},
                                                      ],
                                            Severity: Minor
                                            Found in services/blocks.js and 1 other location - About 55 mins to fix
                                            services/blocks.js on lines 1612..1616

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

                                            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 formSpecs = [
                                                    {
                                                      type: 'text',
                                                      title: _tcStr('Enter the output blocks'),
                                                      value: '',
                                            Severity: Minor
                                            Found in services/blocks.js and 1 other location - About 45 mins to fix
                                            services/blocks.js on lines 390..401

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

                                            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 formSpecs = [
                                                    {
                                                      type: 'text',
                                                      title: _tcStr('Enter the constant blocks'),
                                                      value: '',
                                            Severity: Minor
                                            Found in services/blocks.js and 1 other location - About 45 mins to fix
                                            services/blocks.js on lines 239..250

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

                                            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 (
                                                        block.data.name !== portInfo.name ||
                                                        block.data.virtual !== virtual ||
                                                        block.data.clock !== clock
                                                      ) {
                                            Severity: Minor
                                            Found in services/blocks.js and 1 other location - About 45 mins to fix
                                            services/blocks.js on lines 1315..1341

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

                                            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 (
                                                        block.data.name !== portInfo.name ||
                                                        block.data.virtual !== virtual ||
                                                        block.data.blockColor !== color
                                                      ) {
                                            Severity: Minor
                                            Found in services/blocks.js and 1 other location - About 45 mins to fix
                                            services/blocks.js on lines 1425..1450

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

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

                                                      if (portInfo.rangestr && clock) {
                                                        evt.cancel = true;
                                                        resultAlert = alertify.warning(
                                                          _tcStr('Clock not allowed for data buses')
                                                        );
                                            Severity: Major
                                            Found in services/blocks.js and 3 other locations - About 35 mins to fix
                                            services/blocks.js on lines 123..129
                                            services/blocks.js on lines 206..212
                                            services/blocks.js on lines 1175..1181

                                            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

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

                                                      if (portInfo.rangestr && clock) {
                                                        evt.cancel = true;
                                                        resultAlert = alertify.warning(
                                                          _tcStr('Clock not allowed for data buses')
                                                        );
                                            Severity: Major
                                            Found in services/blocks.js and 3 other locations - About 35 mins to fix
                                            services/blocks.js on lines 123..129
                                            services/blocks.js on lines 1175..1181
                                            services/blocks.js on lines 1388..1394

                                            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

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

                                                      if (portInfo.rangestr && clock) {
                                                        evt.cancel = true;
                                                        resultAlert = alertify.warning(
                                                          _tcStr('Clock not allowed for data buses')
                                                        );
                                            Severity: Major
                                            Found in services/blocks.js and 3 other locations - About 35 mins to fix
                                            services/blocks.js on lines 123..129
                                            services/blocks.js on lines 206..212
                                            services/blocks.js on lines 1388..1394

                                            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

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

                                                      if (portInfo.rangestr && clock) {
                                                        evt.cancel = true;
                                                        resultAlert = alertify.warning(
                                                          _tcStr('Clock not allowed for data buses')
                                                        );
                                            Severity: Major
                                            Found in services/blocks.js and 3 other locations - About 35 mins to fix
                                            services/blocks.js on lines 206..212
                                            services/blocks.js on lines 1175..1181
                                            services/blocks.js on lines 1388..1394

                                            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