Growstuff/growstuff

View on GitHub

Showing 4,022 of 4,059 total issues

CSRF vulnerability in OmniAuth's request phase
Open

omniauth (1.9.2)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Server side request forgery in gibbon
Open

gibbon (1.2.1)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Class Crop has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

class Crop < ApplicationRecord
extend FriendlyId
include PhotoCapable
include OpenFarmData
include GbifData
Severity: Minor
Found in app/models/crop.rb - About 2 hrs to fix

Method show has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def show
@member = Member.confirmed.kept.find_by!(slug: params[:slug])
@twitter_auth = @member.auth('twitter')
@flickr_auth = @member.auth('flickr')
@posts = @member.posts
Severity: Minor
Found in app/controllers/members_controller.rb - About 1 hr to fix

Method create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def create
auth = request.env['omniauth.auth']
action = Growstuff::OauthSignupAction.new
 
@authentication = nil
Severity: Minor
Found in app/controllers/omniauth_callbacks_controller.rb - About 1 hr to fix

Method planting_reminder has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def planting_reminder(member)
@member = member
@sitename = ENV.fetch('GROWSTUFF_SITE_NAME', nil)
 
@late = []
Severity: Minor
Found in app/mailers/notifier_mailer.rb - About 55 mins to fix

Method create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def create
ActiveRecord::Base.transaction do
@photo = find_or_create_photo_from_flickr_photo
@item = item_to_link_to
raise "Could not find this #{type} owned by you" unless @item
Severity: Minor
Found in app/controllers/photos_controller.rb - About 45 mins to fix

Method planting_status has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def planting_status(planting)
if planting.crop.perennial
t 'planting.status.perennial'
elsif planting.finished?
t 'planting.status.finished'
Severity: Minor
Found in app/helpers/plantings_helper.rb - About 45 mins to fix

Method show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def show
@member = Member.confirmed.kept.find_by!(slug: params[:slug])
@twitter_auth = @member.auth('twitter')
@flickr_auth = @member.auth('flickr')
@posts = @member.posts
Severity: Minor
Found in app/controllers/members_controller.rb - About 45 mins to fix

Identical blocks of code found in 2 locations. Consider refactoring.
Open

@member.plantings.active.annual.each do |planting|
if planting.finish_is_predicatable?
if planting.super_late?
@super_late << planting
elsif planting.late?
Severity: Minor
Found in app/mailers/notifier_mailer.rb and 1 other location - About 25 mins to fix
app/controllers/members_controller.rb on lines 30..40

Identical blocks of code found in 2 locations. Consider refactoring.
Open

@member.plantings.active.annual.each do |planting|
if planting.finish_is_predicatable?
if planting.super_late?
@super_late << planting
elsif planting.late?
Severity: Minor
Found in app/controllers/members_controller.rb and 1 other location - About 25 mins to fix
app/mailers/notifier_mailer.rb on lines 37..47

Method display_human_quantity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def display_human_quantity(harvest)
return unless harvest.quantity.present? && harvest.quantity > 0
 
if harvest.unit == 'individual' # just the number
number_to_human(harvest.quantity, strip_insignificant_zeros: true)
Severity: Minor
Found in app/helpers/harvests_helper.rb - About 25 mins to fix

Method thumbnail_url has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def thumbnail_url
df = default_photo
 
return unless df
 
 
Severity: Minor
Found in app/models/concerns/photo_capable.rb - About 25 mins to fix

Method display_garden_plantings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def display_garden_plantings(plantings)
if plantings.blank?
"None"
else
output = '<ul class="plantings">'
Severity: Minor
Found in app/helpers/gardens_helper.rb - About 25 mins to fix

rlh units not allowed on max-height; must be one of (%, Hz, ch, cm, deg, dpcm, dpi, dppx, em, ex, grad, in, kHz, mm, ms, pc, pt, px, q, rad, rem, s, turn, vh, vmax, vmin, vw)
Open

max-height: 1rlh;

Selector should have depth of applicability no greater than 2, but was 4
Open

a:hover {

Avoid using id selectors
Open

#maincontainer {

Color red should be written in hexadecimal form as #ff0000
Open

color: red;

Rule declaration should be followed by an empty line
Open

}

Rule declaration should be followed by an empty line
Open

}
Severity
Category
Status
Source
Language