RadarParlamentar-MES2017-1/radar

View on GitHub
radar_parlamentar/static/files/codes/js/d3.layout.cloud.js

Summary

Maintainability
D
2 days
Test Coverage

Function cloud has 164 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function cloud() {
    var size = [256, 256],
        text = cloudText,
        font = cloudFont,
        fontSize = cloudFontSize,
Severity: Major
Found in radar_parlamentar/static/files/codes/js/d3.layout.cloud.js - About 6 hrs to fix

    File d3.layout.cloud.js has 351 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Word cloud layout by Jason Davies, http://www.jasondavies.com/word-cloud/
    // Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf
    (function() {
      function cloud() {
        var size = [256, 256],
    Severity: Minor
    Found in radar_parlamentar/static/files/codes/js/d3.layout.cloud.js - About 4 hrs to fix

      Function cloudSprite has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function cloudSprite(d, data, di) {
          if (d.sprite) return;
          c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);
          var x = 0,
              y = 0,
      Severity: Major
      Found in radar_parlamentar/static/files/codes/js/d3.layout.cloud.js - About 3 hrs to fix

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

            function place(board, tag, bounds) {
              var perimeter = [{x: 0, y: 0}, {x: size[0], y: size[1]}],
                  startX = tag.x,
                  startY = tag.y,
                  maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),
        Severity: Minor
        Found in radar_parlamentar/static/files/codes/js/d3.layout.cloud.js - About 1 hr to fix

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

              cloud.start = function() {
                var board = zeroArray((size[0] >> 5) * size[1]),
                    bounds = null,
                    n = words.length,
                    i = -1,
          Severity: Minor
          Found in radar_parlamentar/static/files/codes/js/d3.layout.cloud.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                          for (var i = 0; i <= w; i++) {
                            board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);
                          }
            Severity: Major
            Found in radar_parlamentar/static/files/codes/js/d3.layout.cloud.js - About 45 mins to fix

              TODO found
              Open

                // TODO reuse arrays?

              TODO found
              Open

                      // TODO only check for collisions within current bounds.

              There are no issues that match your filters.

              Category
              Status