juanmard/icestudio

View on GitHub

Showing 203 of 447 total issues

Function updatePortsAttrs has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  updatePortsAttrs: function (/*eventName*/) {
    'use strict';

    if (this._portSelectors) {
      var newAttrs = _.omit(this.get('attrs'), this._portSelectors);
Severity: Major
Found in graphics/joint.shapes.js - About 2 hrs to fix

    Function generateCode has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          function generateCode(cmd) {
            return new Promise(function (resolve) {
              project.snapshot();
              project.update();
              var opt = {
    Severity: Major
    Found in services/tools.js - About 2 hrs to fix

      Function _addBlockFile has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            function _addBlockFile(self, orig, name, data, notify) {
              function _importBlock() {
                self.addBlock(block);
                if (notify) {
                  alertify.success(
      Severity: Major
      Found in services/project.js - About 2 hrs to fix

        Function confirm has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          this.confirm = function (opts) {
            /* Options
                  body             string or DOM element
                  closable         boolean
                  closableByDimmer boolean
        Severity: Major
        Found in services/alerts.js - About 2 hrs to fix

          Function revertCommand has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            revertCommand: function (command) {
              'use strict';
              this.stopListening();
          
              var batchCommand;
          Severity: Major
          Found in graphics/joint.command.js - About 2 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 updateBox has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                updateBox: function (element) {
                  'use strict';
              
                  var bbox = element.getBBox();
                  var state = this.options.state;
              Severity: Major
              Found in graphics/joint.selection.js - About 2 hrs to fix

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

                  adjustSelection: function (evt) {
                    'use strict';
                
                    var dx;
                    var dy;
                Severity: Major
                Found in graphics/joint.selection.js - About 2 hrs to fix

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

                        function ICEToolRun(commands, startMessage, endMessage) {
                          return new Promise(function (resolve) {
                            var sourceCode = '';
                  
                            if (!taskRunning) {
                  Severity: Major
                  Found in services/tools.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

                      Consider simplifying this complex logical expression.
                      Open

                                    if (
                                      (source.id === cell.id &&
                                        containsPort(source.port, size, cell.get('rightPorts'))) ||
                                      (target.id === cell.id &&
                                        containsPort(target.port, size, cell.get('leftPorts')) &&
                      Severity: Critical
                      Found in services/blocks.js - About 2 hrs to fix

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

                          function router(vertices, opt) {
                            resolveOptions(opt);
                        
                            /* jshint -W040 */
                        
                        
                        Severity: Minor
                        Found in graphics/joint.routers.js - About 1 hr 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 alert has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              this.alert = function (opts) {
                                /* Options
                                    body             string or DOM element
                                    closable         boolean
                                    closableByDimmer boolean
                            Severity: Minor
                            Found in services/alerts.js - About 1 hr to fix

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

                                Function appEnable has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      this.appEnable = function (value) {
                                        paper.options.enabled = value;
                                        var ael, i;
                                        if (value) {
                                          /* In the new javascript context of nwjs, angular can't change classes over the dom in this way,
                                Severity: Minor
                                Found in services/graph.js - About 1 hr to fix

                                  Function applyCommand has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    applyCommand: function (command) {
                                      'use strict';
                                      this.stopListening();
                                  
                                      var batchCommand;
                                  Severity: Minor
                                  Found in graphics/joint.command.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 applyCommand has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    applyCommand: function (command) {
                                      'use strict';
                                      this.stopListening();
                                  
                                      var batchCommand;
                                  Severity: Minor
                                  Found in graphics/joint.command.js - About 1 hr to fix

                                    Function fitContent has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          this.fitContent = function () {
                                            if (!this.isEmpty()) {
                                              // Target box
                                              var margin = 40;
                                              var menuFooterHeight = 93;
                                    Severity: Minor
                                    Found in services/graph.js - About 1 hr to fix

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

                                        renderPorts: function () {
                                          'use strict';
                                      
                                          var $leftPorts = this.$('.leftPorts').empty();
                                          var $rightPorts = this.$('.rightPorts').empty();
                                      Severity: Minor
                                      Found in graphics/joint.shapes.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language