AgileVentures/LocalSupport

View on GitHub

Showing 117 of 792 total issues

Class has too many lines. [165/100]
Open

class Organisation < BaseOrganisation

  has_many :volunteer_ops
  has_many :users
  has_many :edits, class_name: 'ProposedOrganisationEdit', dependent: :destroy
Severity: Minor
Found in app/models/organisation.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [136/100]
Open

class ApplicationController < ActionController::Base
  protect_from_forgery
  before_action :store_location,
                :assign_footer_page_links,
                :set_tags,

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [131/100]
Open

class VolunteerOpsController < ApplicationController
  layout :choose_layout

  before_action :set_organisation, only: [:new, :create]
  before_action :authorize, except: [:search, :show, :index]

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [106/100]
Open

class OrganisationsController < BaseOrganisationsController
  layout :choose_layout

  before_action :authenticate_user!, except: [:search, :index, :show]
  prepend_before_action :set_organisation, only: [:show, :update, :edit]

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [22/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def build_single_marker(model, marker)
    location = model.first
    models = model.last
    if model.first.try(:source)
      source = VolunteerOp.get_source(models)

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class Organisation has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

class Organisation < BaseOrganisation

  has_many :volunteer_ops
  has_many :users
  has_many :edits, class_name: 'ProposedOrganisationEdit', dependent: :destroy
Severity: Minor
Found in app/models/organisation.rb - About 3 hrs to fix

    Method has too many lines. [18/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def self.build params
        params.require(:proposed_organisation).permit(
          :superadmin_email_to_add,
          :description,
          :address,

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Class ApplicationController has 25 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class ApplicationController < ActionController::Base
      protect_from_forgery
      before_action :store_location,
                    :assign_footer_page_links,
                    :set_tags,
    Severity: Minor
    Found in app/controllers/application_controller.rb - About 2 hrs to fix

      Method has too many lines. [15/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
      Open

        def devise_error_messages!
          return "" if resource.errors.empty?
      
          errors = resource.errors
          reset_token_error = errors.to_hash.fetch(:reset_password_token,'')
      Severity: Minor
      Found in app/helpers/devise_helper.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method has too many lines. [15/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
      Open

        def organisation_params
          params.require(:organisation).permit(
            :superadmin_email_to_add,
            :description,
            :address,

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Class VolunteerOpsController has 23 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class VolunteerOpsController < ApplicationController
        layout :choose_layout
      
        before_action :set_organisation, only: [:new, :create]
        before_action :authorize, except: [:search, :show, :index]
      Severity: Minor
      Found in app/controllers/volunteer_ops_controller.rb - About 2 hrs to fix

        Method has too many lines. [13/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
        Open

          def build_map_markers(organisations)
            ::MapMarkerJson.build(organisations) do |org, marker|
              marker.lat org.latitude
              marker.lng org.longitude
              marker.infowindow render_to_string(partial: 'organisations/popup', locals: {org: org})

        This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

        Method has too many lines. [13/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
        Open

          def populate_vol_op_attributes model, op
            location = Location.new longitude: op['lng'], latitude: op['lat']
            model.source        = 'doit'
            model.latitude      = location.latitude
            model.longitude     = location.longitude

        This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

        Method has too many lines. [12/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
        Open

          def populate_vol_op_attributes(op, model, coordinates)
            location = Location.create coordinates
            model.source = 'reachskills'
            model.latitude  = location.latitude
            model.longitude = location.longitude

        This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

        Function initMap has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          initMap: function initMap() {
            Settings.zoom = parseInt($("#marker_data").data().zoom || '12', 10)
            Settings.lat = parseFloat($("#marker_data").data().latitude || '51.5978')
            Settings.lng = parseFloat($("#marker_data").data().longitude || '-0.3370')
            Settings.geojsonUrl1 = $("#marker_data").data().geojsonUrl1 
        Severity: Major
        Found in app/assets/javascripts/maps.js - About 2 hrs to fix

          Assignment Branch Condition size for devise_error_messages! is too high. [19.52/15] (http://c2.com/cgi/wiki?AbcMetric)
          Open

            def devise_error_messages!
              return "" if resource.errors.empty?
          
              errors = resource.errors
              reset_token_error = errors.to_hash.fetch(:reset_password_token,'')
          Severity: Minor
          Found in app/helpers/devise_helper.rb by rubocop

          This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

          Assignment Branch Condition size for after_sign_in_path_for is too high. [19.42/15] (http://c2.com/cgi/wiki?AbcMetric)
          Open

            def after_sign_in_path_for(resource)
              set_flash_warning_reminder_to_update_details resource
              return edit_user_path id: current_user.id if session[:pending_organisation_id]
              return organisation_path(current_user.organisation) if current_user.organisation
              return session[:previous_url] if session[:previous_url]

          This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

          Assignment Branch Condition size for populate_vol_op_attributes is too high. [19.21/15] (http://c2.com/cgi/wiki?AbcMetric)
          Open

            def populate_vol_op_attributes model, op
              location = Location.new longitude: op['lng'], latitude: op['lat']
              model.source        = 'doit'
              model.latitude      = location.latitude
              model.longitude     = location.longitude

          This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

          Assignment Branch Condition size for populate_vol_op_attributes is too high. [19.21/15] (http://c2.com/cgi/wiki?AbcMetric)
          Open

            def populate_vol_op_attributes(op, model, coordinates)
              location = Location.create coordinates
              model.source = 'reachskills'
              model.latitude  = location.latitude
              model.longitude = location.longitude

          This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

          Method has too many lines. [11/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
          Open

            def self.import(filename, limit, validation)
              csv_text = File.open(filename, 'r:ISO-8859-1')
              count = 0
              CSV.parse(csv_text, headers: true).each do |row|
                break if count >= limit
          Severity: Minor
          Found in app/models/organisation.rb by rubocop

          This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

          Severity
          Category
          Status
          Source
          Language