lujanfernaud/prevy

View on GitHub

Showing 1,727 of 1,727 total issues

SampleGroupCreator#group_name doesn't depend on instance state (maybe move it to another class?)
Open

    def group_name
Severity: Minor
Found in app/services/sample_group_creator.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

SampleEventCreator#event_end_date doesn't depend on instance state (maybe move it to another class?)
Open

    def event_end_date
Severity: Minor
Found in app/services/sample_event_creator.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

ImageUploader#application_name doesn't depend on instance state (maybe move it to another class?)
Open

    def application_name
Severity: Minor
Found in app/uploaders/image_uploader.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

SampleGroupCreator#group_location doesn't depend on instance state (maybe move it to another class?)
Open

    def group_location
Severity: Minor
Found in app/services/sample_group_creator.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

SampleEventCreator#event_website doesn't depend on instance state (maybe move it to another class?)
Open

    def event_website
Severity: Minor
Found in app/services/sample_event_creator.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

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

  def call
    GroupRoleNotification.create(
      user:    user,
      group:   group,
      message: "You now have #{role} role in #{group.name}!"
Severity: Minor
Found in app/services/notifiers/group_roles/new_group_role_notifier.rb and 1 other location - About 20 mins to fix
app/services/notifiers/group_roles/removed_group_role_notifier.rb on lines 14..23

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 28.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def call
    GroupRoleNotification.create(
      user:    user,
      group:   group,
      message: "You no longer have #{role} role in #{group.name}."
app/services/notifiers/group_roles/new_group_role_notifier.rb on lines 14..23

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 28.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

ApplicationDecorator#h has the name 'h'
Open

    def h

An Uncommunicative Method Name is a method name that doesn't communicate its intent well enough.

Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.

ImagePlaceholderCreator#convert_to_base64 has the name 'convert_to_base64'
Open

    def convert_to_base64

An Uncommunicative Method Name is a method name that doesn't communicate its intent well enough.

Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.

ImagePlaceholderCreator has the variable name '@image_base64'
Open

    @image_base64    = ""
  end

  def call
    return if regular_resource_without_image_updated?

An Uncommunicative Variable Name is a variable name that doesn't communicate its intent well enough.

Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.

Group#image_base64 has the name 'image_base64'
Open

  def image_base64
Severity: Minor
Found in app/models/group.rb by reek

An Uncommunicative Method Name is a method name that doesn't communicate its intent well enough.

Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.

Event#image_base64 has the name 'image_base64'
Open

  def image_base64
Severity: Minor
Found in app/models/event.rb by reek

An Uncommunicative Method Name is a method name that doesn't communicate its intent well enough.

Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.

File Content Disclosure in Action View
Open

    actionview (5.1.6)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2019-5418

Criticality: High

URL: https://groups.google.com/forum/#!topic/rubyonrails-security/pFRKI96Sm8Q

Solution: upgrade to >= 4.2.11.1, ~> 4.2.11, >= 5.0.7.2, ~> 5.0.7, >= 5.1.6.2, ~> 5.1.6, >= 5.2.2.1, ~> 5.2.2, >= 6.0.0.beta3

Denial of Service Vulnerability in Action View
Open

    actionview (5.1.6)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2019-5419

Criticality: High

URL: https://groups.google.com/forum/#!topic/rubyonrails-security/GN7w9fFAQeI

Solution: upgrade to >= 6.0.0.beta3, >= 5.2.2.1, ~> 5.2.2, >= 5.1.6.2, ~> 5.1.6, >= 5.0.7.2, ~> 5.0.7, >= 4.2.11.1, ~> 4.2.11

Broken Access Control vulnerability in Active Job
Open

    activejob (5.1.6)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2018-16476

Criticality: High

URL: https://groups.google.com/forum/#!topic/rubyonrails-security/FL4dSdzr2zw

Solution: upgrade to ~> 4.2.11, ~> 5.0.7.1, ~> 5.1.6.1, ~> 5.1.7, >= 5.2.1.1

Inconsistent indentation detected.
Open

    def end_date_formatted
      if same_day?
        end_date.strftime("%H:%M")
      else
        end_date.strftime("%A, %b. %d, %H:%M")
Severity: Minor
Found in app/decorators/event_decorator.rb by rubocop

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Inconsistent indentation detected.
Open

    def h
      ActionController::Base.helpers
    end

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Inconsistent indentation detected.
Open

    def url
      Rails.application.routes.url_helpers
    end

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Inconsistent indentation detected.
Open

    def user_is_organizer_but_not_owner(user)
      user.has_role?(:organizer, self) && !user.owned_groups.include?(self)
    end

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Inconsistent indentation detected.
Open

    def add_user_role
      if group.all_members_can_create_events?
        user.add_role :organizer, group
      else
        user.add_role :member, group
Severity: Minor
Found in app/models/group_membership.rb by rubocop

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end
Severity
Category
Status
Source
Language