juanmard/icestudio

View on GitHub

Showing 203 of 447 total issues

Function BuildCommand has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def BuildCommand(ctx, board, device, package, project_dir, verbose, verbose_yosys, verbose_pnr):
Severity: Major
Found in ICETool/__init__.py - About 1 hr to fix

    Function applyShape has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      applyShape: function () {
        'use strict';
    
        var data = this.model.get('data');
        var name = data.name + (data.range || '');
    Severity: Minor
    Found in graphics/joint.shapes.js - About 55 mins 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 a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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

    Avoid deeply nested control flow statements.
    Open

                  for (var j = 0; j < vB.length - 1; j++) {
                    // Eval if intersects any segment of wire vB
                    if (evalIntersection(vA[i], [vB[j], vB[j + 1]])) {
                      // Bifurcation found!
                      var point = vA[i];
    Severity: Major
    Found in graphics/joint.shapes.js - About 45 mins to fix

      Function getPortAttrs has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        getPortAttrs: function (port, index, total, selector, type, length) {
      Severity: Minor
      Found in graphics/joint.shapes.js - About 45 mins to fix

        Function updateBox has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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

        Avoid deeply nested control flow statements.
        Open

                        switch (common.selectedBoard.name) {
                          // TinyFPGA-B2 programmer errors
                          case 'TinyFPGA-B2':
                          case 'TinyFPGA-BX':
                            var match = stdout.match(/Bootloader\snot\sactive/g);
        Severity: Major
        Found in services/tools.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    if (cssRule.selectorText === ruleName) {
                      return cssRule;
                    }
          Severity: Major
          Found in graphics/joint.shapes.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if (portWires[A].id !== portWires[B].id) {
                          // Not the same wire
                          findBifurcations(
                            portWires[A].view,
                            portWires[B].view,
            Severity: Major
            Found in graphics/joint.shapes.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                if (common.selectedBoard.name.startsWith('TinyFPGA-B')) {
                                  // TinyFPGA bootloader notification
                                  errorMessage +=
                                    '</br>(' + _tcStr('Bootloader not active') + ')';
                                }
              Severity: Major
              Found in services/tools.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              else if (
                                stdout.indexOf('Library not loaded:') !== -1 &&
                                stdout.indexOf('libffi') !== -1
                              ) {
                                resultAlert = alertify.error(
                Severity: Major
                Found in services/tools.js - About 45 mins to fix

                  Function storeBatchCommand has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    storeBatchCommand: function () {
                      'use strict';
                      // In order to store batch command it is necesary to run storeBatchCommand as many times as
                      // initBatchCommand was executed
                      if (this.batchCommand && this.batchLevel <= 0) {
                  Severity: Minor
                  Found in graphics/joint.command.js - About 45 mins 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

                  Avoid deeply nested control flow statements.
                  Open

                                  for (var j in module.params) {
                                    var param = module.params[j];
                                    if (
                                      codeError.line === param.line ||
                                      (matchConstant && param.name === matchConstant[1])
                  Severity: Major
                  Found in services/tools.js - About 45 mins to fix

                    Function getPortAttrs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      getPortAttrs: function (port, index, total, selector, type, length) {
                        'use strict';
                    
                        var attrs = {};
                        var gridsize = 8;
                    Severity: Minor
                    Found in graphics/joint.shapes.js - About 45 mins 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

                    Avoid deeply nested control flow statements.
                    Open

                                  if (vw.target.block === lin.id) {
                                    if (typeof vwiresLut[lin.data.name] === 'undefined') {
                                      vwiresLut[lin.data.name] = {
                                        source: [],
                                        target: [],
                    Severity: Major
                    Found in services/compiler.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                    if (inPort.default && inPort.default.apply) {
                                      initPorts.push({
                                        block: block.id,
                                        port: inPort.name,
                                        name: inPort.default.port,
                      Severity: Major
                      Found in services/compiler.js - About 45 mins to fix

                        Function validateConnection has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                    cellViewS,
                                    magnetS,
                                    cellViewT,
                                    magnetT,
                                    end,
                        Severity: Minor
                        Found in services/graph.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                        for (i in initPins) {
                                          value += initPins[i].bit;
                                        }
                          Severity: Major
                          Found in services/compiler.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        if (wire.target.block === block.id) {
                                          if (
                                            wire.source.port === 'constant-out' ||
                                            wire.source.port === 'memory-out'
                                          ) {
                            Severity: Major
                            Found in services/compiler.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                            if (
                                              wire.source.port !== 'constant-out' &&
                                              wire.source.port !== 'memory-out'
                                            ) {
                                              connectPort(wire.target.port, portsNames, ports, block);
                              Severity: Major
                              Found in services/compiler.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language