juanmard/icestudio

View on GitHub

Showing 203 of 447 total issues

Function appendDesign has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      this.appendDesign = function (design, dependencies) {
        if (
          design &&
          dependencies &&
          design.graph &&
Severity: Minor
Found in services/graph.js - About 1 hr to fix

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

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

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

            function normalizeCodeError(codeError, modules) {
              var newCodeError;
              // Find the module with the error
              for (var i in modules) {
                var module = modules[i];
      Severity: Minor
      Found in services/tools.js - About 1 hr to fix

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

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

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

                this.pasteFromClipboard = function (callback) {
                  nodeCP.paste(function (err, text) {
                    if (err) {
                      if (common.LINUX) {
                        // xclip installation message
          Severity: Minor
          Found in services/utils.js - About 1 hr to fix

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

                  $scope.about = function () {
                    alerts.alert({
                      icon: 'heart-o',
                      title: 'Icestudio, visual editor for Verilog designs',
                      body: $('#about')[0],
            Severity: Minor
            Found in controllers/menu.js - About 1 hr to fix

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

                    this.pasteAndCloneSelected = function () {
                      if (
                        document.activeElement.tagName === 'A' ||
                        document.activeElement.tagName === 'BODY'
                      ) {
              Severity: Minor
              Found in services/graph.js - About 1 hr to fix

                Function mapCodeModules has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      function mapCodeModules(code) {
                        var codelines = code.split('\n');
                        var match,
                          module = {
                            params: [],
                Severity: Minor
                Found in services/tools.js - About 1 hr to fix

                  Function run has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    this.run = function (id) {
                      let plug = this.getById(id);
                  
                      if (plug === false) {
                        return false;
                  Severity: Minor
                  Found in iceplugmanager.js - About 1 hr to fix

                    Function applyText has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      applyText: function () {
                        'use strict';
                    
                        const data = this.model.get('data');
                    
                    
                    Severity: Minor
                    Found in graphics/joint.shapes.js - About 1 hr to fix

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

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

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

                              this.addDraggableCells = function (cells) {
                                this.addingDraggableBlock = true;
                                var menuHeight = $('#menu').height();
                                if (cells.length > 0) {
                                  var firstCell = cells[0];
                        Severity: Minor
                        Found in services/graph.js - About 1 hr to fix

                          Function initialize has 41 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: Minor
                          Found in graphics/joint.shapes.js - About 1 hr to fix

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

                                  this.initializePluginManager = function (callbackOnRun) {
                                    if (typeof ICEpm !== 'undefined') {
                                      console.log('ENV', common);
                                      ICEpm.setEnvironment(common);
                                      ICEpm.setPluginDir(common.DEFAULT_PLUGIN_DIR, function () {
                            Severity: Minor
                            Found in services/tools.js - About 1 hr to fix

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

                                this.plug = function (
                                  id,
                                  userOptions,
                                  callback_onconnect,
                                  callback_onreceive
                              Severity: Minor
                              Found in plugins/serial-term/js/main.js - About 1 hr to fix

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

                                  this.plug = function (
                                    id,
                                    userOptions,
                                    callback_onconnect,
                                    callback_onreceive
                                Severity: Minor
                                Found in plugins/icerok/js/SerialManager.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

                                    Function startCapture has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function startCapture(button) {
                                      if (server) {
                                        UARTtoggleButtonState(button);
                                    
                                        if (server.isUARTConnected()) {
                                    Severity: Minor
                                    Found in plugins/icerok/js/index.js - About 1 hr 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 updateBox has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      updateBox: function () {
                                        'use strict';
                                    
                                        var bbox = this.model.getBBox();
                                        var state = this.model.get('state');
                                    Severity: Minor
                                    Found in graphics/joint.shapes.js - About 1 hr to fix

                                      Function renderLabels has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        renderLabels: function () {
                                          'use strict';
                                      
                                          if (!this._V.labels) {
                                            return this;
                                      Severity: Minor
                                      Found in graphics/joint.shapes.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language