mysociety/alaveteli

View on GitHub

Showing 122 of 630 total issues

Function Plot has 1911 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function Plot(placeholder, data_, options_, plugins) {
        // data is on the form:
        //   [ series1, series2 ... ]
        // where series is either just the data as [ [x1, y1], [x2, y2], ... ]
        // or { data: [ [x1, y1], [x2, y2], ... ], label: "some label", ... }
Severity: Major
Found in app/assets/javascripts/jquery.flot.js - About 1 wk to fix

    File selectize.js has 2497 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * sifter.js
     * Copyright (c) 2013 Brian Reavis & contributors
     *
     * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
    Severity: Major
    Found in app/assets/javascripts/alaveteli_pro/selectize.js - About 6 days to fix

      File jquery.flot.js has 2154 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* Javascript plotting library for jQuery, version 0.8.2-alpha.
      
      Copyright (c) 2007-2013 IOLA and Ole Laursen.
      Licensed under the MIT license.
      
      
      Severity: Major
      Found in app/assets/javascripts/jquery.flot.js - About 5 days to fix

        File info_request.rb has 1376 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'digest/sha1'
        require 'fileutils'
        
        class InfoRequest < ActiveRecord::Base
          Guess = Struct.new(:info_request, :matched_value, :match_method).freeze
        Severity: Major
        Found in app/models/info_request.rb - About 3 days to fix

          Class InfoRequest has 144 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class InfoRequest < ActiveRecord::Base
            Guess = Struct.new(:info_request, :matched_value, :match_method).freeze
            OLD_AGE_IN_DAYS = 21.days
          
            include AdminColumn
          Severity: Major
          Found in app/models/info_request.rb - About 2 days to fix

            File request_controller.rb has 929 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'zip'
            require 'open-uri'
            
            class RequestController < ApplicationController
              before_action :check_read_only, :only => [ :new, :describe_state, :upload_response ]
            Severity: Major
            Found in app/controllers/request_controller.rb - About 2 days to fix

              File acts_as_xapian.rb has 773 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              begin
                require 'xapian'
                $acts_as_xapian_bindings_available = true
              rescue LoadError
                STDERR.puts "acts_as_xapian: No Ruby bindings for Xapian installed"
              Severity: Major
              Found in lib/acts_as_xapian/acts_as_xapian.rb - About 1 day to fix

                File public_body.rb has 692 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'csv'
                require 'securerandom'
                require 'set'
                require 'confidence_intervals'
                
                
                Severity: Major
                Found in app/models/public_body.rb - About 1 day to fix

                  Class User has 71 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class User < ActiveRecord::Base
                    include AlaveteliFeatures::Helpers
                    include AlaveteliPro::PhaseCounts
                    include User::Authentication
                  
                  
                  Severity: Major
                  Found in app/models/user.rb - About 1 day to fix

                    File routes.rb has 565 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    include AlaveteliFeatures::Constraints
                    
                    # Allow easy extension from themes. Note these will have the highest priority.
                    $alaveteli_route_extensions.each do |f|
                      load File.join('config', f)
                    Severity: Major
                    Found in config/routes.rb - About 1 day to fix

                      File user.rb has 523 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      class User < ActiveRecord::Base
                        include AlaveteliFeatures::Helpers
                        include AlaveteliPro::PhaseCounts
                        include User::Authentication
                      
                      
                      Severity: Major
                      Found in app/models/user.rb - About 1 day to fix

                        Method get_language_name has 191 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def self.get_language_name(locale)
                            language_names = {
                              'ab'    => 'аҧсуа',
                              'aa'    => 'Afaraf',
                              'af'    => 'Afrikaans',
                        Severity: Major
                        Found in lib/languages.rb - About 7 hrs to fix

                          Function drawSeriesLines has 187 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function drawSeriesLines(series) {
                                      function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
                                          var points = datapoints.points,
                                              ps = datapoints.pointsize,
                                              prevx = null, prevy = null;
                          Severity: Major
                          Found in app/assets/javascripts/jquery.flot.js - About 7 hrs to fix

                            Class PublicBody has 51 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            class PublicBody < ActiveRecord::Base
                              include AdminColumn
                            
                              class ImportCSVDryRun < StandardError ; end
                            
                            
                            Severity: Major
                            Found in app/models/public_body.rb - About 7 hrs to fix

                              Function drawGrid has 177 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      function drawGrid() {
                                          var i, axes, bw, bc;
                              
                                          ctx.save();
                                          ctx.translate(plotOffset.left, plotOffset.top);
                              Severity: Major
                              Found in app/assets/javascripts/jquery.flot.js - About 7 hrs to fix

                                Function processData has 167 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        function processData() {
                                            var topSentry = Number.POSITIVE_INFINITY,
                                                bottomSentry = Number.NEGATIVE_INFINITY,
                                                fakeInfinity = Number.MAX_VALUE,
                                                i, j, k, m, length,
                                Severity: Major
                                Found in app/assets/javascripts/jquery.flot.js - About 6 hrs to fix

                                  Function d3TimeSeries has 158 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function d3TimeSeries(selector, data, title, metric_name) {
                                  
                                    // Add the title
                                    var wrapper_element = document.querySelectorAll(selector)[0];
                                  
                                  
                                  Severity: Major
                                  Found in app/assets/javascripts/time_series.js - About 6 hrs to fix

                                    Function setup has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            setup: function() {
                                                var self      = this;
                                                var settings  = self.settings;
                                                var eventNS   = self.eventNS;
                                                var $window   = $(window);
                                    Severity: Major
                                    Found in app/assets/javascripts/alaveteli_pro/selectize.js - About 5 hrs to fix

                                      Function selectize has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          $.fn.selectize = function(settings_user) {
                                              var defaults             = $.fn.selectize.defaults;
                                              var settings             = $.extend({}, defaults, settings_user);
                                              var attr_data            = settings.dataAttr;
                                              var field_label          = settings.labelField;
                                      Severity: Major
                                      Found in app/assets/javascripts/alaveteli_pro/selectize.js - About 4 hrs to fix

                                        Function init has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            function init(plot) {
                                                // Taken from flot-axislabels.
                                                // This is kind of a hack. There are no hooks in Flot between
                                                // the creation and measuring of the ticks (setTicks, measureTickLabels
                                                // in setupGrid() ) and the drawing of the ticks and plot box
                                        Severity: Major
                                        Found in app/assets/javascripts/jquery.flot.tickrotor.js - About 4 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language