loomio/loomio

View on GitHub
app/services/record_cloner.rb

Summary

Maintainability
C
1 day
Test Coverage

File record_cloner.rb has 393 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class RecordCloner
  def initialize(recorded_at:)
    @recorded_at = recorded_at
    @cache = {}
  end
Severity: Minor
Found in app/services/record_cloner.rb - About 5 hrs to fix

    Class RecordCloner has 23 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class RecordCloner
      def initialize(recorded_at:)
        @recorded_at = recorded_at
        @cache = {}
      end
    Severity: Minor
    Found in app/services/record_cloner.rb - About 2 hrs to fix

      Method new_clone_poll has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def new_clone_poll(poll)
          copy_fields = %w[
            author_id
            closing_at
            closed_at
      Severity: Major
      Found in app/services/record_cloner.rb - About 2 hrs to fix

        Method new_clone_group has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def new_clone_group(group, clone_parent = nil)
            copy_fields = %w[
              name
              description
              description_format
        Severity: Minor
        Found in app/services/record_cloner.rb - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status