ikuseiGmbH/smart-village-app-cms

View on GitHub

Showing 1,158 of 1,254 total issues

Authentication#settings is a writable attribute
Open

  attr_accessor :client_id, :client_secret, :settings
Severity: Minor
Found in app/services/authentication.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)

SmartVillageApi#user is a writable attribute
Open

  attr_accessor :user
Severity: Minor
Found in app/services/smart_village_api.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)

Importer::WasteCalendar#waste_types is a writable attribute
Open

  attr_accessor :smart_village, :waste_types, :address_data, :tour_data, :address_assignment,

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)

Converter::Base#remove_quotes_from_keys doesn't depend on instance state (maybe move it to another class?)
Open

    def remove_quotes_from_keys(data)
Severity: Minor
Found in app/services/converter/base.rb by reek

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

Importer::WasteCalendar#tour_data is a writable attribute
Open

  attr_accessor :smart_village, :waste_types, :address_data, :tour_data, :address_assignment,

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)

Converter::Base#convert_to_json doesn't depend on instance state (maybe move it to another class?)
Open

    def convert_to_json(data)
Severity: Minor
Found in app/services/converter/base.rb by reek

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

Importer::WasteCalendar#address_assignment is a writable attribute
Open

  attr_accessor :smart_village, :waste_types, :address_data, :tour_data, :address_assignment,

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)

Importer::WasteCalendar#address_data is a writable attribute
Open

  attr_accessor :smart_village, :waste_types, :address_data, :tour_data, :address_assignment,

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)

Converter::Base#convert_keys_to_camelcase doesn't depend on instance state (maybe move it to another class?)
Open

    def convert_keys_to_camelcase(data)
Severity: Minor
Found in app/services/converter/base.rb by reek

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

Importer::WasteCalendar#smart_village is a writable attribute
Open

  attr_accessor :smart_village, :waste_types, :address_data, :tour_data, :address_assignment,

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)

Importer::WasteCalendar#tour_assignment is a writable attribute
Open

                :tour_assignment

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)

Authentication#client_id is a writable attribute
Open

  attr_accessor :client_id, :client_secret, :settings
Severity: Minor
Found in app/services/authentication.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)

Converter::Base#cleanup doesn't depend on instance state (maybe move it to another class?)
Open

    def cleanup(data)
Severity: Minor
Found in app/services/converter/base.rb by reek

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

Converter::Base#remove_quotes_from_boolean_values doesn't depend on instance state (maybe move it to another class?)
Open

    def remove_quotes_from_boolean_values(data)
Severity: Minor
Found in app/services/converter/base.rb by reek

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

Avoid parameter lists longer than 5 parameters. [6/5]
Open

  def initialize(
    smart_village:,
    waste_types:,
    address_data:,
    tour_data:,

This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

Complex method NewsItemsController#update (20.4)
Open

  def update
    news_id = params[:id]

    unless category_present?(news_item_params)
      flash[:error] = "Bitte eine Kategorie auswählen"

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

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

  def edit
    results = @smart_village.query <<~GRAPHQL
      query {
        genericItem(
          id: #{params[:id]}
Severity: Major
Found in app/controllers/offers_controller.rb and 6 other locations - About 20 mins to fix
app/controllers/constructions_controller.rb on lines 40..87
app/controllers/deadlines_controller.rb on lines 42..100
app/controllers/events_controller.rb on lines 45..205
app/controllers/jobs_controller.rb on lines 40..114
app/controllers/point_of_interests_controller.rb on lines 40..169
app/controllers/tours_controller.rb on lines 40..146

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 7 locations. Consider refactoring.
Open

  def edit
    results = @smart_village.query <<~GRAPHQL
      query {
        pointOfInterest(
          id: #{params[:id]}
Severity: Major
Found in app/controllers/point_of_interests_controller.rb and 6 other locations - About 20 mins to fix
app/controllers/constructions_controller.rb on lines 40..87
app/controllers/deadlines_controller.rb on lines 42..100
app/controllers/events_controller.rb on lines 45..205
app/controllers/jobs_controller.rb on lines 40..114
app/controllers/offers_controller.rb on lines 38..99
app/controllers/tours_controller.rb on lines 40..146

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 7 locations. Consider refactoring.
Open

  def edit
    results = @smart_village.query <<~GRAPHQL
      query {
        genericItem(
          id: #{params[:id]}
Severity: Major
Found in app/controllers/constructions_controller.rb and 6 other locations - About 20 mins to fix
app/controllers/deadlines_controller.rb on lines 42..100
app/controllers/events_controller.rb on lines 45..205
app/controllers/jobs_controller.rb on lines 40..114
app/controllers/offers_controller.rb on lines 38..99
app/controllers/point_of_interests_controller.rb on lines 40..169
app/controllers/tours_controller.rb on lines 40..146

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 7 locations. Consider refactoring.
Open

  def edit
    results = @smart_village.query <<~GRAPHQL
      query {
        tour(
          id: #{params[:id]}
Severity: Major
Found in app/controllers/tours_controller.rb and 6 other locations - About 20 mins to fix
app/controllers/constructions_controller.rb on lines 40..87
app/controllers/deadlines_controller.rb on lines 42..100
app/controllers/events_controller.rb on lines 45..205
app/controllers/jobs_controller.rb on lines 40..114
app/controllers/offers_controller.rb on lines 38..99
app/controllers/point_of_interests_controller.rb on lines 40..169

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

Severity
Category
Status
Source
Language