RadarParlamentar-MES2017-1/radar

View on GitHub

Showing 117 of 377 total issues

Function bind has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function bind(group, groupData) {
    var i,
        n = group.length,
        m = groupData.length,
        n0 = Math.min(n, m),
Severity: Major
Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

    Function d3_transition has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function d3_transition(groups, id, time) {
      d3_arraySubclass(groups, d3_transitionPrototype);
    
      var tweens = {},
          event = d3.dispatch("start", "end"),
    Severity: Major
    Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

      Function arc has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      d3.svg.arc = function() {
        var innerRadius = d3_svg_arcInnerRadius,
            outerRadius = d3_svg_arcOuterRadius,
            startAngle = d3_svg_arcStartAngle,
            endAngle = d3_svg_arcEndAngle;
      Severity: Major
      Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

        ImportadorVotacoesSenado has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class ImportadorVotacoesSenado:
        
            """Salva os dados dos arquivos XML do senado no banco de dados"""
        
            def __init__(self):
        Severity: Minor
        Found in radar_parlamentar/importadores/sen.py - About 2 hrs to fix

          File grafico.py has 275 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # !/usr/bin/python
          # coding=utf8
          
          # Copyright (C) 2012, Leonardo Leite, Saulo Trento, Diego Rabatone
          #
          Severity: Minor
          Found in radar_parlamentar/analises/grafico.py - About 2 hrs to fix

            Function _data_inicio_prox_periodo has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                def _data_inicio_prox_periodo(self, data_inicio_periodo):
                    # TODO tb extrair e fazer testes
                    # dia
                    dia_inicial = 1
                    # mês
            Severity: Minor
            Found in radar_parlamentar/modelagem/utils.py - About 2 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 chord has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            d3.svg.chord = function() {
              var source = d3_svg_chordSource,
                  target = d3_svg_chordTarget,
                  radius = d3_svg_chordRadius,
                  startAngle = d3_svg_arcStartAngle,
            Severity: Major
            Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

              Function nest has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              d3.nest = function() {
                var nest = {},
                    keys = [],
                    sortKeys = [],
                    sortValues,
              Severity: Major
              Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

                Function d3_scale_ordinal has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function d3_scale_ordinal(domain, ranger) {
                  var index,
                      range,
                      rangeBand;
                
                
                Severity: Major
                Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

                  Function interpolateString has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  d3.interpolateString = function(a, b) {
                    var m, // current match
                        i, // current index
                        j, // current index (for coallescing)
                        s0 = 0, // start index of current string prefix
                  Severity: Major
                  Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

                    File 0001_initial.py has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    
                    from south.db import db
                    from south.v2 import SchemaMigration
                    from django.db import models
                    Severity: Minor
                    Found in radar_parlamentar/modelagem/migrations/0001_initial.py - About 2 hrs to fix

                      Function zoom has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      d3.behavior.zoom = function() {
                        var xyz = [0, 0, 0],
                            event = d3.dispatch("zoom"),
                            extent = d3_behavior_zoomInfiniteExtent;
                      
                      
                      Severity: Major
                      Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

                        Function d3_svg_area has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function d3_svg_area(projection) {
                          var x0 = d3_svg_lineX,
                              x1 = d3_svg_lineX,
                              y0 = 0,
                              y1 = d3_svg_lineY,
                        Severity: Major
                        Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

                          Function espelha_ou_roda has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def espelha_ou_roda(self, por_partido=False, so_espelha=True):
                                  """Retorna nova AnalisePeriodo com coordenadas rotacionadas
                                  se por_partido = True:
                                  a operacao minimiza o quanto os partidos caminharam
                                  se por_partido = False:
                          Severity: Minor
                          Found in radar_parlamentar/analises/analise.py - About 2 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 d3_scale_log has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function d3_scale_log(linear, log) {
                            var pow = log.pow;
                          
                            function scale(x) {
                              return linear(log(x));
                          Severity: Major
                          Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

                            Function d3_scale_linear has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function d3_scale_linear(domain, range, interpolate, clamp) {
                              var output,
                                  input;
                            
                              function rescale() {
                            Severity: Major
                            Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

                              Function format has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              d3.format = function(specifier) {
                                var match = d3_format_re.exec(specifier),
                                    fill = match[1] || " ",
                                    sign = match[3] || "",
                                    zfill = match[5],
                              Severity: Minor
                              Found in radar_parlamentar/static/files/codes/js/d3.js - About 2 hrs to fix

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

                                  function display(d) {
                                    grandparent
                                        .datum(d.parent)
                                        .on("click", transition)
                                      .select("text")
                                Severity: Minor
                                Found in radar_parlamentar/static/files/codes/js/genero_treemap.js - About 1 hr to fix

                                  Function _calcula_parlamentares_2d has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def _calcula_parlamentares_2d(self):
                                          """Retorna mapa com as coordenadas de parlamentares no plano 2D formado
                                          pelas duas primeiras componentes principais.
                                  
                                          A chave do mapa é o id do parlamentar (int) e o valor é uma lista
                                  Severity: Minor
                                  Found in radar_parlamentar/analises/analise.py - 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 interpolateTransform has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  d3.interpolateTransform = function(a, b) {
                                    var s = [], // string constants and placeholders
                                        q = [], // number interpolators
                                        n,
                                        A = d3.transform(a),
                                  Severity: Minor
                                  Found in radar_parlamentar/static/files/codes/js/d3.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language