juanmard/icestudio

View on GitHub

Showing 203 of 447 total issues

Function initialize has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  initialize: function () {
    'use strict';

    _.bindAll(this, 'updateBox');
    joint.dia.ElementView.prototype.initialize.apply(this, arguments);
Severity: Major
Found in graphics/joint.shapes.js - About 3 hrs to fix

    Function updateBox has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

      updateBox: function () {
        'use strict';
    
        var pendingTasks = [];
        var i, port;
    Severity: Minor
    Found in graphics/joint.shapes.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

    File joint.command.js has 322 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.command.js - About 3 hrs to fix

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

      let SerialManager = function () {
        this.devices = [];
        this.info = {
          status: false,
          dev: -1,
      Severity: Major
      Found in plugins/icerok/js/SerialManager.js - About 3 hrs to fix

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

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

          Function initialize has 92 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            initialize: function () {
              'use strict';
          
              _.bindAll(this, 'updateBox');
              joint.dia.ElementView.prototype.initialize.apply(this, arguments);
          Severity: Major
          Found in graphics/joint.shapes.js - About 3 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 parametric has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                this.parametric = new (function () {
                  'use strict';
              
                  this.pair = function (A, B) {
                    if (A.length !== B.length) {
              Severity: Major
              Found in iceplugmanager.js - About 3 hrs to fix

                File iceplugmanager.js has 315 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* eslint-disable no-unused-vars */
                
                var ICEpm = new (function () {
                  'use strict';
                
                
                Severity: Minor
                Found in iceplugmanager.js - About 3 hrs to fix

                  Function load has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        this.load = function (name, data) {
                          var self = this;
                          if (!checkVersion(data.version)) {
                            return;
                          }
                  Severity: Major
                  Found in services/project.js - About 3 hrs to fix

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

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

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

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

                        Function initialize has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          initialize: function () {
                            'use strict';
                        
                            _.bindAll(this, 'updateBox');
                            joint.dia.ElementView.prototype.initialize.apply(this, arguments);
                        Severity: Major
                        Found in graphics/joint.shapes.js - About 3 hrs to fix

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

                            updateBox: function () {
                              'use strict';
                          
                              var bbox = this.model.getBBox();
                              var data = this.model.get('data');
                          Severity: Major
                          Found in graphics/joint.shapes.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 addCollections has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    this.addCollections = function (filepaths) {
                                      // Load zip file
                                      async.eachSeries(filepaths, function (filepath, nextzip) {
                                        //alertify.message(_tcStr('Load {{name}} ...', { name: `<b>${common.basename(filepath)}</b>` }));
                                        var zipData = nodeAdmZip(filepath);
                              Severity: Major
                              Found in services/tools.js - About 3 hrs to fix

                                Function revertCommand has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  revertCommand: function (command) {
                                    'use strict';
                                    this.stopListening();
                                
                                    var batchCommand;
                                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

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

                                  getPortAttrs: function (port, index, total, selector, type, length) {
                                    'use strict';
                                
                                    var attrs = {};
                                    var gridsize = 8;
                                Severity: Major
                                Found in graphics/joint.shapes.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 convertTo10 has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          function convertTo10(data, name) {
                                            var project = {
                                              version: '1.0',
                                              package: {
                                                name: name || '',
                                    Severity: Major
                                    Found in services/project.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language