3scale/porta

View on GitHub
app/lib/fields/base_field.rb

Summary

Maintainability
A
0 mins
Test Coverage

Fields::BaseField#label is a writable attribute
Open

  attr_accessor :name, :label, :type, :required, :choices, :hint, :hidden, :options
Severity: Minor
Found in app/lib/fields/base_field.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)

Fields::BaseField#required is a writable attribute
Open

  attr_accessor :name, :label, :type, :required, :choices, :hint, :hidden, :options
Severity: Minor
Found in app/lib/fields/base_field.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)

Fields::BaseField#hint is a writable attribute
Open

  attr_accessor :name, :label, :type, :required, :choices, :hint, :hidden, :options
Severity: Minor
Found in app/lib/fields/base_field.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)

Fields::BaseField#type is a writable attribute
Open

  attr_accessor :name, :label, :type, :required, :choices, :hint, :hidden, :options
Severity: Minor
Found in app/lib/fields/base_field.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)

Fields::BaseField#choices is a writable attribute
Open

  attr_accessor :name, :label, :type, :required, :choices, :hint, :hidden, :options
Severity: Minor
Found in app/lib/fields/base_field.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)

Fields::BaseField#options is a writable attribute
Open

  attr_accessor :name, :label, :type, :required, :choices, :hint, :hidden, :options
Severity: Minor
Found in app/lib/fields/base_field.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)

Fields::BaseField#hidden is a writable attribute
Open

  attr_accessor :name, :label, :type, :required, :choices, :hint, :hidden, :options
Severity: Minor
Found in app/lib/fields/base_field.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)

Fields::BaseField#name is a writable attribute
Open

  attr_accessor :name, :label, :type, :required, :choices, :hint, :hidden, :options
Severity: Minor
Found in app/lib/fields/base_field.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)

Fields::BaseField#input has unused parameter 'builder'
Open

  def input(builder)
Severity: Minor
Found in app/lib/fields/base_field.rb by reek

Unused Parameter refers to methods with parameters that are unused in scope of the method.

Having unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.

Example

Given:

class Klass
  def unused_parameters(x,y,z)
    puts x,y # but not z
  end
end

Reek would emit the following warning:

[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)

There are no issues that match your filters.

Category
Status