juanmard/icestudio

View on GitHub

Showing 447 of 447 total issues

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

/* eslint-disable new-cap */

var os = require('os');
var sha1 = require('sha1');
var marked = require('marked');
Severity: Major
Found in graphics/joint.shapes.js - About 1 wk to fix

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

    angular
      .module('icestudio')
      .service('blocks', function ($log, joint, utils, common, gettextCatalog) {
        'use strict';
    
    
    Severity: Major
    Found in services/blocks.js - About 4 days to fix

      File graph.js has 1482 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable new-cap */
      
      angular
        .module('icestudio')
        .service(
      Severity: Major
      Found in services/graph.js - About 3 days to fix

        Function createPaper has 542 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              this.createPaper = function (element) {
                graph = new joint.dia.Graph();
        
                paper = new joint.dia.Paper({
                  el: element,
        Severity: Major
        Found in services/graph.js - About 2 days to fix

          File menu.js has 981 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable camelcase */
          
          angular
            .module('icestudio')
            .controller(
          Severity: Major
          Found in controllers/menu.js - About 2 days to fix

            File tools.js has 956 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            angular
              .module('icestudio')
              .service(
                'tools',
                function (
            Severity: Major
            Found in services/tools.js - About 2 days to fix

              Function ice has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
              Open

              joint.routers.ice = (function (g, _, joint) {
                'use strict';
              
                var config = {
                  // size of the step to find a route
              Severity: Minor
              Found in graphics/joint.routers.js - About 2 days 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

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

                joint.routers.ice = (function (g, _, joint) {
                  'use strict';
                
                  var config = {
                    // size of the step to find a route
                Severity: Major
                Found in graphics/joint.routers.js - About 1 day to fix

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

                      if (data && data.ports && data.ports.in) {
                        tokId = 'port-default-' + modelId + '-';
                        for (i = 0; i < data.ports.in.length; i++) {
                          port = data.ports.in[i];
                          portDefault = document.getElementById(tokId + port.name);
                  Severity: Major
                  Found in graphics/joint.shapes.js and 2 other locations - About 1 day to fix
                  graphics/joint.shapes.js on lines 711..753
                  graphics/joint.shapes.js on lines 1188..1230

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

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

                      if (data && data.ports && data.ports.in) {
                        tokId = 'port-default-' + modelId + '-';
                        for (i = 0; i < data.ports.in.length; i++) {
                          port = data.ports.in[i];
                          portDefault = document.getElementById(tokId + port.name);
                  Severity: Major
                  Found in graphics/joint.shapes.js and 2 other locations - About 1 day to fix
                  graphics/joint.shapes.js on lines 1188..1230
                  graphics/joint.shapes.js on lines 2199..2240

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

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

                      if (data && data.ports && data.ports.in) {
                        tokId = 'port-default-' + modelId + '-';
                        for (i = 0; i < data.ports.in.length; i++) {
                          port = data.ports.in[i];
                          portDefault = document.getElementById(tokId + port.name);
                  Severity: Major
                  Found in graphics/joint.shapes.js and 2 other locations - About 1 day to fix
                  graphics/joint.shapes.js on lines 711..753
                  graphics/joint.shapes.js on lines 2199..2240

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

                  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 = 0; i < this.nativeDom.fpgaContentSelector.length; i++) {
                        pendingTasks.push({
                          e: this.nativeDom.fpgaContentSelector[i],
                          property: 'left',
                          value: Math.round((bbox.width / 2.0) * (state.zoom - 1)) + 'px',
                  Severity: Major
                  Found in graphics/joint.shapes.js and 1 other location - About 1 day to fix
                  graphics/joint.shapes.js on lines 1233..1263

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

                  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 = 0; i < this.nativeDom.virtualContentSelector.length; i++) {
                        pendingTasks.push({
                          e: this.nativeDom.virtualContentSelector[i],
                          property: 'left',
                          value: Math.round((bbox.width / 2.0) * (state.zoom - 1)) + 'px',
                  Severity: Major
                  Found in graphics/joint.shapes.js and 1 other location - About 1 day to fix
                  graphics/joint.shapes.js on lines 1267..1297

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

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

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

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

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

                  Refactorings

                  Further Reading

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

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

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 285.

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

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

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

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

                  Refactorings

                  Further Reading

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

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

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 285.

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

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

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

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

                  Refactorings

                  Further Reading

                  Function ICEpm has 312 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var ICEpm = new (function () {
                    'use strict';
                  
                    this.pluginDir = false;
                    this.pluginUri = false;
                  Severity: Major
                  Found in iceplugmanager.js - About 1 day to fix

                    File project.js has 684 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    angular
                      .module('icestudio')
                      .service(
                        'project',
                        function (
                    Severity: Major
                    Found in services/project.js - About 1 day to fix

                      Function processResult has 310 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            function processResult(result, code) {
                              result = result || {};
                              var _error = result.error;
                              var stdout = result.stdout;
                              var stderr = result.stderr;
                      Severity: Major
                      Found in services/tools.js - About 1 day to fix

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

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

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 280.

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

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

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

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

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language