SpeciesFileGroup/taxonworks

View on GitHub
lib/tasks/batch_load/documentations.rake

Summary

Maintainability
Test Coverage

Avoid more than 3 levels of block nesting.
Open

                        if documentation.nil?
                          documentation = Documentation.new(document: document, documentation_object: identifier_object)

                          if documentation.valid?
                            documentation.save!

This cop checks for excessive nesting of conditional and looping constructs.

You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

The maximum level of nesting allowed is configurable.

Avoid more than 3 levels of block nesting.
Open

                        if document.valid?
                          document.save!
                          documents_created += 1
                        else
                          puts Rainbow("Document invalid on row #{rows_processed} - #{document.errors.full_messages.join("; ")}").red

This cop checks for excessive nesting of conditional and looping constructs.

You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

The maximum level of nesting allowed is configurable.

There are no issues that match your filters.

Category
Status