ikuseiGmbH/Goldencobra

View on GitHub
app/models/goldencobra/import.rb

Summary

Maintainability
A
0 mins
Test Coverage

Goldencobra::Import has no descriptive comment
Open

  class Import < ActiveRecord::Base
Severity: Minor
Found in app/models/goldencobra/import.rb by reek

Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.

Example

Given

class Dummy
  # Do things...
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [1]:Dummy has no descriptive comment (IrresponsibleModule)

Fixing this is simple - just an explaining comment:

# The Dummy class is responsible for ...
class Dummy
  # Do things...
end

Line is too long. [125/100]
Open

  #   accepts_nested_attributes_for :upload, allow_destroy: true, reject_if: proc { |attributes| attributes['image'].blank? }
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [132/100]
Open

  #       master_object = create_or_update_target_model(self.target_model,self.target_model,master_data_attribute_assignments, row )
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Unnecessary utf-8 encoding comment.
Open

# encoding: utf-8
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks ensures source files have no utf-8 encoding comments.

Example:

# bad
# encoding: UTF-8
# coding: UTF-8
# -*- coding: UTF-8 -*-

Line is too long. [121/100]
Open

  #   DataHandling = [["bestehenden Datensatz suchen oder erstellen","update"],["Datensatz immer neu anlegen", "create"]]
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [105/100]
Open

  #     import_data_attribute_assignments = all_data_attribute_assignments["Goldencobra::ImportMetadata"]
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [128/100]
Open

  #     @get_model_attributes ||= eval("#{self.target_model}.new.attributes").delete_if{|a| BlockedAttributes.include?(a) }.keys
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [121/100]
Open

  #         data_to_search = parse_data_with_method(value['csv'],value['data_function'],value['option'], model_name, row)
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [106/100]
Open

  #                 add_current_submodel_to_model(current_object, current_sub_object, sub_attribute_name )
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [123/100]
Open

  #               sub_sub_assignments = self.assignment["#{current_object.class.to_s}"][attribute_name][sub_attribute_name]
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [152/100]
Open

  #                   sub_data_to_save = parse_data_with_method(value['csv'],value['data_function'],value['option'], current_sub_object.class.to_s, row)
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Use compact module/class definition instead of nested style.
Open

module Goldencobra
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the style of children definitions at classes and modules. Basically there are two different styles:

Example: EnforcedStyle: nested (default)

# good
# have each child on its own line
class Foo
  class Bar
  end
end

Example: EnforcedStyle: compact

# good
# combine definitions as much as possible
class Foo::Bar
end

The compact style is only forced for classes/modules with one child.

Line is too long. [142/100]
Open

  #             data_to_save = parse_data_with_method(value['csv'],value['data_function'],value['option'], "Goldencobra::ImportMetadata", row)
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [127/100]
Open

  #   def create_or_update_target_model(assignment_groups_definition,target_model,master_data_attribute_assignments, data_row )
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [106/100]
Open

  #         return find_or_create_by_attributes(master_data_attribute_assignments, data_row, target_model)
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Incorrect indentation detected (column 2 instead of 4).
Open

  #   end
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cops checks the indentation of comments.

Example:

# bad
  # comment here
def method_name
end

  # comment here
a = 'hello'

# yet another comment
  if true
    true
  end

# good
# comment here
def method_name
end

# comment here
a = 'hello'

# yet another comment
if true
  true
end

Extra blank line detected.
Open


  #   def init_nested_attributes
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Line is too long. [143/100]
Open

# Jedes Model welches eigene Importfunktionen anbieten will muss lediglich eine liste der verfügbaren funktionen ImportDataFunctions = [] haben
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [101/100]
Open

  #         raise "all_data_attribute_assignments is blank!" if all_data_attribute_assignments.blank?
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [189/100]
Open

  #   #SELECT COUNT(*) FROM `providers` WHERE (title = 'Sportgemeinschaft Siemens Berlin e. V.' AND category_id = '3' AND metatag_external_id = '1804' AND metatag_created_at = '06.01.2010')
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [125/100]
Open

  #     value.present? && ((value['data_function'].present? && value['data_function'] != 'Default') || value['csv'].present?)
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Extra blank line detected.
Open


  #   def create_or_update_target_model(assignment_groups_definition,target_model,master_data_attribute_assignments, data_row )
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Extra blank line detected.
Open


  #   def get_associations_for_current_object(current_object)
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Line is too long. [167/100]
Open

  #   BlockedAttributes = ["id", "created_at", "updated_at", "url_name", "slug", "upload_id", "images", "article_images", "article_widgets", "permissions", "versions"]
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Extra blank line detected.
Open


  #   def run!
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Line is too long. [103/100]
Open

  #       data = CSV.read(self.upload.image.path, "r:#{self.encoding_type}", {col_sep: self.separator})
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [101/100]
Open

  #     data = CSV.read(self.upload.image.path, "r:#{self.encoding_type}", {col_sep: self.separator})
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [170/100]
Open

  #       self.assignment[key].delete_if{|k,v| v['data_function'] == "Default" && v['csv'].blank?} if self.assignment[key].present? && self.assignment[key].class == Array
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Add an empty line after magic comments.
Open

# == Schema Information
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

Checks for a newline after the final magic comment.

Example:

# good
# frozen_string_literal: true

# Some documentation for Person
class Person
  # Some code
end

# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
  # Some code
end

Line is too long. [126/100]
Open

  #           #Wenn das Aktuell zu speichernde Attribute kein attribute sondern eine Assoziazion zu einem anderen Model ist...
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [131/100]
Open

  #   EncodingTypes = ["UTF-8","ISO-8859-1", "ISO-8859-2", "ISO-8859-16", "US-ASCII", "Big5", "UTF-16BE", "IBM437", "Windows-1252"]
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [104/100]
Open

  #         raise "current_object is blank: #{key}, #{sub_assignments}, #{row}" if current_object.blank?
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [110/100]
Open

  #                   current_sub_object.send("#{sub_ass_item}=", sub_data_to_save) if sub_data_to_save.blank?
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [200/100]
Open

  #               current_sub_object = create_or_update_target_model("#{current_object.class.to_s}_#{cass_related_sub_model.class.to_s}_#{sub_attribute_name}",attribute_name,sub_sub_assignments, row )
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [109/100]
Open

  #         return model_name.constantize.send(data_function.parameterize.underscore, row_data, data_option )
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [141/100]
Open

  #       self.result << "Dieses Object exisitiert schon mehrfach, keine eindeutige Zuweisung möglich: Erstes Objekt wird verwendet (#{row})"
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [112/100]
Open

  #       if data_function.present? && model_name.constantize.respond_to?(data_function.parameterize.underscore)
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [153/100]
Open

  #       current_target_model.reflect_on_all_associations.collect { |r| r.name }.delete_if{|a| Goldencobra::Import::BlockedAttributes.include?(a.to_s) }
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [162/100]
Open

  #       self.target_model.constantize.reflect_on_all_associations.collect { |r| r.name }.delete_if{|a| Goldencobra::Import::BlockedAttributes.include?(a.to_s) }
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [119/100]
Open

  #             self.assignment["#{current_object.class.to_s}"][attribute_name].each do |sub_attribute_name, sub_value|
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [140/100]
Open

  #               data_to_save = parse_data_with_method(value['csv'],value['data_function'],value['option'], current_object.class.to_s, row)
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Line is too long. [113/100]
Open

  #             #Wenn das Aktuell zu speichernde Attribute wirklich ein Attribute ist, kann es gespeichert werden
Severity: Minor
Found in app/models/goldencobra/import.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

There are no issues that match your filters.

Category
Status