juanmard/icestudio

View on GitHub

Showing 447 of 447 total issues

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

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

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

    joint.shapes.ice.InputLabel = joint.shapes.ice.Model.extend({
      markup: `<g class="rotatable">
                 <g class="scalable">
                   <rect class="body" />
                 </g>
    Severity: Major
    Found in graphics/joint.shapes.js and 1 other location - About 4 hrs to fix
    graphics/joint.shapes.js on lines 877..907

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

    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

    joint.shapes.ice.OutputLabel = joint.shapes.ice.Model.extend({
      markup: `<g class="rotatable">
                 <g class="scalable">
                   <rect class="body"/>
                 </g>
    Severity: Major
    Found in graphics/joint.shapes.js and 1 other location - About 4 hrs to fix
    graphics/joint.shapes.js on lines 845..875

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

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

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

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

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

    Refactorings

    Further Reading

    File joint.selection.js has 342 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
    Copyright (c) 2016-2019 FPGAwars
    Copyright (c) 2013 client IO
    */
    
    
    Severity: Minor
    Found in graphics/joint.selection.js - About 4 hrs to fix

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

      var serialManager = function () {
        this.devices = [];
        this.info = {
          status: false,
          dev: -1,
      Severity: Major
      Found in plugins/serial-term/js/main.js - About 4 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

            File preferences.js has 334 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // Please note that $uibModalInstance represents a modal window (instance) dependency.
            // It is not the same as the $uibModal service.
            
            /* eslint-disable camelcase */
            
            
            Severity: Minor
            Found in controllers/preferences.js - About 4 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                      if (
                        event.keyCode === command.key &&
                        event.altKey === (command.alt || false) &&
                        event.ctrlKey === (command.ctrl || false) &&
                        event.metaKey === (command.meta || false) &&
              Severity: Critical
              Found in services/shortcuts.js - About 4 hrs to fix

                Function updateBifurcations has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  updateBifurcations: function () {
                    'use strict';
                
                    if (this._V.markerBifurcations) {
                      var self = this;
                Severity: Major
                Found in graphics/joint.shapes.js - About 4 hrs to fix

                  Function findRoute has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function findRoute(start, end, map, opt) {
                      var step = opt.step;
                      var startPoints, endPoints;
                      var startCenter, endCenter;
                  
                  
                  Severity: Major
                  Found in graphics/joint.routers.js - About 3 hrs to fix

                    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

                    Function addCommand has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                    Open

                      addCommand: function (cmdName, cell, graph, options) {
                        'use strict';
                    
                        if (cmdName === 'change:labels' || cmdName === 'change:z') {
                          return;
                    Severity: Minor
                    Found in graphics/joint.command.js - About 3 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Severity
                    Category
                    Status
                    Source
                    Language