hpi-swt2/sport-portal

View on GitHub
app/models/event/ranking_entry.rb

Summary

Maintainability
A
0 mins
Test Coverage

Event::RankingEntry has at least 12 instance variables
Open

  class RankingEntry
Severity: Minor
Found in app/models/event/ranking_entry.rb by reek

Too Many Instance Variables is a special case of LargeClass.

Example

Given this configuration

TooManyInstanceVariables:
  max_instance_variables: 3

and this code:

class TooManyInstanceVariables
  def initialize
    @arg_1 = :dummy
    @arg_2 = :dummy
    @arg_3 = :dummy
    @arg_4 = :dummy
  end
end

Reek would emit the following warning:

test.rb -- 5 warnings:
  [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)

Event::RankingEntry#rank is a writable attribute
Open

    attr_accessor :rank
Severity: Minor
Found in app/models/event/ranking_entry.rb by reek

A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.

The same holds to a lesser extent for getters, but Reek doesn't flag those.

Example

Given:

class Klass
  attr_accessor :dummy
end

Reek would emit the following warning:

reek test.rb

test.rb -- 1 warning:
  [2]:Klass declares the writable attribute dummy (Attribute)

There are no issues that match your filters.

Category
Status