juanmard/icestudio

View on GitHub
services/compiler.js

Summary

Maintainability
F
2 wks
Test Coverage

File compiler.js has 929 lines of code (exceeds 250 allowed). Consider refactoring.
Open

angular
  .module('icestudio')
  .service('compiler', function (common, utils, _package) {
    'use strict';

Severity: Major
Found in services/compiler.js - About 2 days to fix

    Function getContent has 172 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function getContent(name, project) {
          var i, j, w;
          var content = [];
          var graph = project.design.graph;
          var connections = {
    Severity: Major
    Found in services/compiler.js - About 6 hrs to fix

      Function verilogCompiler has 113 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function verilogCompiler(name, project, opt) {
            var i,
              data,
              block,
              code = '';
      Severity: Major
      Found in services/compiler.js - About 4 hrs to fix

        Function testbenchCompiler has 91 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function testbenchCompiler(project) {
              var i, o, p;
              var code = '';
        
              code += '// Testbench template\n\n';
        Severity: Major
        Found in services/compiler.js - About 3 hrs to fix

          Function getInstances has 79 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function getInstances(name, graph) {
                var w, wire;
                var instances = [];
                var blocks = graph.blocks;
          
          
          Severity: Major
          Found in services/compiler.js - About 3 hrs to fix

            Function pcfCompiler has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function pcfCompiler(project, opt) {
                  var i,
                    j,
                    block,
                    pin,
            Severity: Major
            Found in services/compiler.js - About 3 hrs to fix

              Function lpfCompiler has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function lpfCompiler(project) {
                    var i,
                      block,
                      pin,
                      value,
              Severity: Major
              Found in services/compiler.js - About 2 hrs to fix

                Function generate has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    this.generate = function (target, project, opt) {
                      var content = '';
                      var files = [];
                      switch (target) {
                        case 'verilog':
                Severity: Major
                Found in services/compiler.js - About 2 hrs to fix

                  Function module has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function module(data) {
                        var code = '';
                        if (data && data.name && data.ports) {
                          // Header
                          code += '\nmodule ' + data.name;
                  Severity: Minor
                  Found in services/compiler.js - About 1 hr to fix

                    Function mainIO has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function mainIO(project) {
                          var input = [];
                          var output = [];
                          var inputUnnamed = 0;
                          var outputUnnamed = 0;
                    Severity: Minor
                    Found in services/compiler.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if (
                                block.type !== 'basic.input' &&
                                block.type !== 'basic.output' &&
                                block.type !== 'basic.constant' &&
                                block.type !== 'basic.memory' &&
                      Severity: Major
                      Found in services/compiler.js - About 1 hr to fix

                        Avoid deeply nested control flow statements.
                        Open

                                      if (inPort.default && inPort.default.apply) {
                                        initPorts.push({
                                          block: block.id,
                                          port: inPort.name,
                                          name: inPort.default.port,
                        Severity: Major
                        Found in services/compiler.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                        for (i in blocks) {
                                          block = blocks[i];
                                          if (
                                            block.type === 'basic.input' &&
                                            !block.data.range &&
                          Severity: Major
                          Found in services/compiler.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                          if (!found) {
                                            // Add imaginary input block with the initPort value
                                            project.design.graph.blocks.push({
                                              id: initPort.name,
                                              type: 'basic.input',
                            Severity: Major
                            Found in services/compiler.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                            if (
                                              wire.source.port !== 'constant-out' &&
                                              wire.source.port !== 'memory-out'
                                            ) {
                                              connectPort(wire.target.port, portsNames, ports, block);
                              Severity: Major
                              Found in services/compiler.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                              if (vw.target.block === lin.id) {
                                                if (typeof vwiresLut[lin.data.name] === 'undefined') {
                                                  vwiresLut[lin.data.name] = {
                                                    source: [],
                                                    target: [],
                                Severity: Major
                                Found in services/compiler.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                if (vw.source.block === lin.id) {
                                                  if (typeof vwiresLut[lin.data.name] === 'undefined') {
                                                    vwiresLut[lin.data.name] = {
                                                      source: [],
                                                      target: [],
                                  Severity: Major
                                  Found in services/compiler.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                  if (block.type !== 'basic.code') {
                                                    paramName = utils.digestId(paramName);
                                                  }
                                    Severity: Major
                                    Found in services/compiler.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                    for (i in initPins) {
                                                      value += initPins[i].bit;
                                                    }
                                      Severity: Major
                                      Found in services/compiler.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                    if (wire.target.block === block.id) {
                                                      if (
                                                        wire.source.port === 'constant-out' ||
                                                        wire.source.port === 'memory-out'
                                                      ) {
                                        Severity: Major
                                        Found in services/compiler.js - About 45 mins to fix

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

                                                    if (lin.type === 'basic.inputLabel') {
                                                      for (widx in graph.wires) {
                                                        vw = graph.wires[widx];
                                                        if (vw.target.block === lin.id) {
                                                          if (typeof vwiresLut[lin.data.name] === 'undefined') {
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 7 hrs to fix
                                          services/compiler.js on lines 238..254

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

                                          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 (lin.type === 'basic.outputLabel') {
                                                      for (widx in graph.wires) {
                                                        vw = graph.wires[widx];
                                                        if (vw.source.block === lin.id) {
                                                          if (typeof vwiresLut[lin.data.name] === 'undefined') {
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 7 hrs to fix
                                          services/compiler.js on lines 222..237

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

                                          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.type === 'basic.input') {
                                                    if (block.data.name) {
                                                      input.push({
                                                        id: utils.digestId(block.id),
                                                        name: block.data.name.replace(/ /g, '_'),
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 5 hrs to fix
                                          services/compiler.js on lines 1090..1104

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

                                          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.type === 'basic.output') {
                                                    if (block.data.name) {
                                                      output.push({
                                                        id: utils.digestId(block.id),
                                                        name: block.data.name.replace(/ /g, '_'),
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 5 hrs to fix
                                          services/compiler.js on lines 1076..1104

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

                                          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 (wi = 0, wn = graph.wires.length; wi < wn; wi++) {
                                                  if (
                                                    typeof graph.wires[wi].tcTodelete !== 'undefined' &&
                                                    graph.wires[wi].tcTodelete === true
                                                  ) {
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 3 hrs to fix
                                          services/compiler.js on lines 380..389

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

                                          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 (wi = 0, wn = graph.wiresVirtual.length; wi < wn; wi++) {
                                                  if (
                                                    typeof graph.wiresVirtual[wi].tcTodelete !== 'undefined' &&
                                                    graph.wiresVirtual[wi].tcTodelete === true
                                                  ) {
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 3 hrs to fix
                                          services/compiler.js on lines 391..400

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

                                          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 input) {
                                                  content +=
                                                    'reg ' +
                                                    (input[i].range ? input[i].range + ' ' : '') +
                                                    input[i].name +
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 3 hrs to fix
                                          services/compiler.js on lines 974..981

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

                                          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 output) {
                                                  content +=
                                                    'wire ' +
                                                    (output[o].range ? output[o].range + ' ' : '') +
                                                    output[o].name +
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 3 hrs to fix
                                          services/compiler.js on lines 966..973

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

                                          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.type !== 'basic.input' &&
                                                    block.type !== 'basic.output' &&
                                                    block.type !== 'basic.constant' &&
                                                    block.type !== 'basic.memory' &&
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 2 hrs to fix
                                          services/utils.js on lines 516..552

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

                                          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 i in data.ports.in) {
                                                    var _in = data.ports.in[i];
                                                    ports.push(' input ' + (_in.range ? _in.range + ' ' : '') + _in.name);
                                                  }
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 2 hrs to fix
                                          services/compiler.js on lines 109..114

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

                                          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 o in data.ports.out) {
                                                    var _out = data.ports.out[o];
                                                    ports.push(
                                                      ' output ' + (_out.range ? _out.range + ' ' : '') + _out.name
                                                    );
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 2 hrs to fix
                                          services/compiler.js on lines 105..108

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

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

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

                                                      if (
                                                        block.type === 'basic.input' &&
                                                        !block.data.range &&
                                                        !block.data.virtual &&
                                                        initPort.pin === block.data.pins[0].value
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 1 hr to fix
                                          services/compiler.js on lines 613..622

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

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

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

                                                          if (
                                                            block.type === 'basic.input' &&
                                                            !block.data.range &&
                                                            !block.data.virtual &&
                                                            initPort.pin === block.data.pins[0].value
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 1 hr to fix
                                          services/compiler.js on lines 787..796

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

                                          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.type === 'basic.input') {
                                                    ports.in.push({
                                                      name: utils.digestId(block.id),
                                                      range: block.data.range ? block.data.range : '',
                                                    });
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 1 hr to fix
                                          services/compiler.js on lines 185..190

                                          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

                                                  } else if (block.type === 'basic.output') {
                                                    ports.out.push({
                                                      name: utils.digestId(block.id),
                                                      range: block.data.range ? block.data.range : '',
                                                    });
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 1 hr to fix
                                          services/compiler.js on lines 180..190

                                          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 i in input) {
                                                  code +=
                                                    'main_tb.' +
                                                    input[i].name +
                                                    (input[i].range ? input[i].range : '') +
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 1 hr to fix
                                          services/compiler.js on lines 1057..1063

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

                                          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 o in output) {
                                                  code +=
                                                    'main_tb.' +
                                                    output[o].name +
                                                    (output[o].range ? output[o].range : '') +
                                          Severity: Major
                                          Found in services/compiler.js and 1 other location - About 1 hr to fix
                                          services/compiler.js on lines 1050..1056

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

                                          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

                                                  case 'pcf':
                                                    content += header('#', opt);
                                                    content += pcfCompiler(project, opt);
                                                    files.push({
                                                      name: 'main.pcf',
                                          Severity: Minor
                                          Found in services/compiler.js and 1 other location - About 50 mins to fix
                                          services/compiler.js on lines 27..34

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 51.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

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

                                                  case 'lpf':
                                                    content += header('#', opt);
                                                    content += lpfCompiler(project, opt);
                                                    files.push({
                                                      name: 'main.lpf',
                                          Severity: Minor
                                          Found in services/compiler.js and 1 other location - About 50 mins to fix
                                          services/compiler.js on lines 19..26

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 51.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

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

                                                  case 'testbench':
                                                    content += header('//', opt);
                                                    content += testbenchCompiler(project);
                                                    files.push({
                                                      name: 'main_tb.v',
                                          Severity: Minor
                                          Found in services/compiler.js and 1 other location - About 45 mins to fix
                                          services/compiler.js on lines 47..54

                                          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

                                                  case 'gtkwave':
                                                    content += header('[*]', opt);
                                                    content += gtkwaveCompiler(project);
                                                    files.push({
                                                      name: 'main_tb.gtkw',
                                          Severity: Minor
                                          Found in services/compiler.js and 1 other location - About 45 mins to fix
                                          services/compiler.js on lines 39..46

                                          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

                                                if (_params.length > 0) {
                                                  content += ' #(\n';
                                                  content += _params.join(',\n');
                                                  content += '\n)';
                                                }
                                          Severity: Minor
                                          Found in services/compiler.js and 1 other location - About 35 mins to fix
                                          services/compiler.js on lines 997..1001

                                          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

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

                                                if (_ports.length > 0) {
                                                  content += ' (\n';
                                                  content += _ports.join(',\n');
                                                  content += '\n)';
                                                }
                                          Severity: Minor
                                          Found in services/compiler.js and 1 other location - About 35 mins to fix
                                          services/compiler.js on lines 988..992

                                          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