CLOSER-Cohorts/archivist

View on GitHub
app/models/control_construct.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Method has too many lines. [36/30]
Open

  def no_circular_references
    if parent_id.present?
      sql = <<-SQL
      WITH RECURSIVE ancestry_check AS (
          SELECT
Severity: Minor
Found in app/models/control_construct.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method no_circular_references has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def no_circular_references
    if parent_id.present?
      sql = <<-SQL
      WITH RECURSIVE ancestry_check AS (
          SELECT
Severity: Minor
Found in app/models/control_construct.rb - About 1 hr to fix

Method find_nearest_parent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def find_nearest_parent(target_class)
    columns = ['id', 'parent_id', 'construct_id', 'construct_type']
    columns_joined = columns.join(',')
    sql =
      <<-SQL
Severity: Minor
Found in app/models/control_construct.rb - About 1 hr to fix

There are no issues that match your filters.

Category
Status