RadarParlamentar-MES2017-1/radar

View on GitHub

Showing 117 of 377 total issues

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

(function(){if (!Date.now) Date.now = function() {
  return +new Date;
};
try {
  document.createElement("div").style.setProperty("opacity", 0, "");
Severity: Major
Found in radar_parlamentar/static/files/codes/js/d3.js - About 1 wk to fix

    Function plot_data has 435 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function plot_data(dados) {
    
            // Inicialmente remove o spinner de loading
            $("#loading").remove();
    
    
    Severity: Major
    Found in radar_parlamentar/static/files/codes/js/radar_plot.js - About 2 days to fix

      File radar_plot.js has 569 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*##############################################################################
      #       Copyright (C) 2013  Diego Rabatone Oliveira, Leonardo Leite,           #
      #                           Saulo Trento                                       #
      #                                                                              #
      #    This program is free software: you can redistribute it and/or modify      #
      Severity: Major
      Found in radar_parlamentar/static/files/codes/js/radar_plot.js - About 1 day to fix

        File analise.py has 485 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # coding=utf8
        
        # Copyright (C) 2012, Leonardo Leite, Saulo Trento, Diego Rabatone,
        # Guilherme Januário
        #
        Severity: Minor
        Found in radar_parlamentar/analises/analise.py - About 7 hrs to fix

          File models.py has 478 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # coding=utf8
          
          # Copyright (C) 2012, Leonardo Leite, Eduardo Hideo, Saulo Trento,
          #                     Diego Rabatone
          #
          Severity: Minor
          Found in radar_parlamentar/modelagem/models.py - About 7 hrs to fix

            Function tip has 183 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            d3.tip = function() {
              var direction = d3_tip_direction,
                  offset    = d3_tip_offset,
                  html      = d3_tip_html,
                  node      = initNode(),
            Severity: Major
            Found in radar_parlamentar/static/files/codes/js/d3-tip.js - About 7 hrs to fix

              File cdep.py has 468 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # !/usr/bin/python
              # coding=utf8
              
              # Copyright (C) 2012, Leonardo Leite, Diego Rabatone, Saulo Trento,
              # Carolina Ramalho, Brenddon Gontijo Furtado
              Severity: Minor
              Found in radar_parlamentar/importadores/cdep.py - About 7 hrs to fix

                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

                  Function axis has 146 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  d3.svg.axis = function() {
                    var scale = d3.scale.linear(),
                        orient = "bottom",
                        tickMajorSize = 6,
                        tickMinorSize = 6,
                  Severity: Major
                  Found in radar_parlamentar/static/files/codes/js/d3.js - About 5 hrs to fix

                    Function brush has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    d3.svg.brush = function() {
                      var event = d3.dispatch("brushstart", "brush", "brushend"),
                          x, // x-scale, optional
                          y, // y-scale, optional
                          extent = [[0, 0], [0, 0]]; // [x0, y0], [x1, y1]
                    Severity: Major
                    Found in radar_parlamentar/static/files/codes/js/d3.js - About 5 hrs to fix

                      Function atualiza_grafico has 134 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function atualiza_grafico(explodindo) {
                                  
                                  
                                  label_nvotacoes.text("Não há votações relacionadas com as palavras chave informadas");
                      
                      
                      Severity: Major
                      Found in radar_parlamentar/static/files/codes/js/radar_plot.js - About 5 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 plot_data has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function plot_data() {
                          
                                  $("#controle").empty();
                                  $("#graficoplenaria").empty();
                          
                          
                          Severity: Major
                          Found in radar_parlamentar/static/files/codes/js/plenaria.js - About 3 hrs to fix

                            Function axis has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function axis(selection) {
                                selection.each(function(d, i, j) {
                                  var g = d3.select(this);
                            
                                  // If selection is a transition, create subtransitions.
                            Severity: Major
                            Found in radar_parlamentar/static/files/codes/js/d3.js - About 3 hrs to fix

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

                              d3_selectionPrototype.data = function(data, join) {
                                var enter = [],
                                    update = [],
                                    exit = [];
                              
                              
                              Severity: Major
                              Found in radar_parlamentar/static/files/codes/js/d3.js - About 3 hrs to fix

                                Function tip has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                                Open

                                d3.tip = function() {
                                  var direction = d3_tip_direction,
                                      offset    = d3_tip_offset,
                                      html      = d3_tip_html,
                                      node      = initNode(),
                                Severity: Minor
                                Found in radar_parlamentar/static/files/codes/js/d3-tip.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 desenhar has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function desenhar(partido){
                                    
                                
                                    d3.json("/static/files/codes/js/genero_historia_partidos.json", function(error, data) {
                                
                                
                                Severity: Major
                                Found in radar_parlamentar/static/files/codes/js/genero_historia_partidos.js - About 3 hrs to fix

                                  Function desenhar has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function desenhar(legislatura){
                                      d3.json("/static/files/codes/js/genero_comparativo_partidos.json", function(error, passa_dados) {
                                  
                                          dados = passa_dados[legislatura];
                                          data = [];

                                    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

                                      File sen.py has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      # !/usr/bin/python
                                      # coding=utf8
                                      
                                      # Copyright (C) 2012, Leonardo Leite
                                      #
                                      Severity: Minor
                                      Found in radar_parlamentar/importadores/sen.py - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language