AgileVentures/LocalSupport

View on GitHub

Showing 792 of 792 total issues

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

  def update
    user = User.find_by_id(params[:id])
    if params[:pending_org_action] == "decline"
      UserOrganisationDecliner.new(self, user, current_user).call
    elsif params[:pending_org_action] == "approve"

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 build_single_marker is too high. [17.49/15] (http://c2.com/cgi/wiki?AbcMetric)
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 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. [9/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def create
    make_user_into_org_admin_of_new_proposed_org
    @proposed_organisation.check_geocode
    if @proposed_organisation.save
      session[:proposed_organisation_id] = @proposed_organisation.id

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. [9/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def update
    # UpdateProposedOrganisationEdit.with(observer: self, params: create_params)
    proposed_edit = ProposedOrganisationEdit.find(update_params.fetch(:id))
    if !proposed_edit_params.empty?
      proposed_edit.accept(proposed_edit_params)

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. [8/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

    def <=> other
      if (@sym == :what_they_do && other.sym == :how_they_help) || (@sym == :what_they_do && other.sym == :who_they_help) ||
        (@sym == :who_they_help && other.sym == :how_they_help)
        -1
      elsif @sym == other.sym
Severity: Minor
Found in app/models/category.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. [8/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def show
    url = 'https://api.github.com/repos/AgileVentures/LocalSupport/contributors'
    uri = URI.parse url
    request = Net::HTTP::Get.new(uri.request_uri)
    http = Net::HTTP.new(uri.host, uri.port)

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. [8/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def index
    @volunteer_ops = displayed_volunteer_ops unless iframe_map?
    @markers = BuildMarkersWithInfoWindow.with(VolunteerOp.build_by_coordinates, self)
    response.headers.delete 'X-Frame-Options' if iframe?

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. [8/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def upgrade
    user = User.find(params[:id])
    if user.superadmin?
      flash[:error] = 'User already site admin!'
    else

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. [8/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

    def self.build params
      params.permit(
          :id,
          :email,
          :password,
Severity: Minor
Found in app/controllers/users_controller.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. [8/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def index
    index_instance_vars_from_params
    index_services_and_markers
    response.headers.delete 'X-Frame-Options'
    

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. [8/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def bootstrap_class_for flash_type
    case flash_type
    when 'warning'
      'alert-warning'
    when 'notice', 'success'
Severity: Minor
Found in app/helpers/application_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. [8/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def destroy
    user = User.find(params[:id])
    if user == current_user
      flash[:error] = "You may not destroy your own account!"
    else

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. [8/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def find_or_create_charities_and_update
    @charities.each do |charity|
      organisation = @model_klass.find_or_create_by! name: charity['name'].titleize 
      organisation.update ({ address: charity['add1'],
                             postcode: charity['postcode'],

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.

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

    def after_inactive_sign_up_path_for(resource)
      if session[:pending_organisation_id]
        UserOrganisationClaimer.new(self, resource, resource).call(session[:pending_organisation_id])
        return organisation_path resource.pending_organisation 
      elsif session[:proposed_org]

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 type is too high. [15.3/15] (http://c2.com/cgi/wiki?AbcMetric)
Open

  def type
    return CategoryType.what_they_do if self.charity_commission_id < 200
    return CategoryType.who_they_help if (self.charity_commission_id < 300) & (self.charity_commission_id > 199)
    return CategoryType.how_they_help if (self.charity_commission_id < 400) & (self.charity_commission_id > 299)
  end
Severity: Minor
Found in app/models/category.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

Function invite_users has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.invite_users = function () {
        $(this).click(function () {
            var values = {},
                checks = $('input:checked');
            checks.each(function () {
Severity: Minor
Found in app/assets/javascripts/invitations.js - About 1 hr to fix

    Possible XSS Vulnerability in Action Pack
    Open

        actionpack (5.2.4.1)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-22577

    Criticality: Medium

    URL: https://groups.google.com/g/ruby-security-ann/c/NuFRKaN5swI

    Solution: upgrade to >= 5.2.7.1, ~> 5.2.7, >= 6.0.4.8, ~> 6.0.4, >= 6.1.5.1, ~> 6.1.5, >= 7.0.2.4

    Regular Expression Denial of Service in websocket-extensions (RubyGem)
    Open

        websocket-extensions (0.1.4)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2020-7663

    Criticality: High

    URL: https://github.com/faye/websocket-extensions-ruby/security/advisories/GHSA-g6wq-qcwm-j5g2

    Solution: upgrade to >= 0.1.5

    Possible RCE escalation bug with Serialized Columns in Active Record
    Open

        activerecord (5.2.4.1)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-32224

    Criticality: Critical

    URL: https://groups.google.com/g/rubyonrails-security/c/MmFO3LYQE8U

    Solution: upgrade to >= 5.2.8.1, ~> 5.2.8, >= 6.0.5.1, ~> 6.0.5, >= 6.1.6.1, ~> 6.1.6, >= 7.0.3.1

    HTTP Request Smuggling in puma
    Open

        puma (4.3.3)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-24790

    Criticality: Critical

    URL: https://github.com/puma/puma/security/advisories/GHSA-h99w-9q5r-gjq9

    Solution: upgrade to ~> 4.3.12, >= 5.6.4

    Severity
    Category
    Status
    Source
    Language