artirix/artirix_data_models

View on GitHub

Showing 11 of 35 total issues

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

  def perform_put(path,
                  authorization_bearer: nil,
                  authorization_token_hash: nil,
                  body: nil,
                  cache_adaptor: nil,
Severity: Major
Found in lib/artirix_data_models/daos/basic_model_dao.rb and 4 other locations - About 1 hr to fix
lib/artirix_data_models/daos/basic_model_dao.rb on lines 175..206
lib/artirix_data_models/daos/basic_model_dao.rb on lines 209..240
lib/artirix_data_models/daos/basic_model_dao.rb on lines 275..305
lib/artirix_data_models/daos/basic_model_dao.rb on lines 307..337

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 67.

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

  def perform_post(path,
                   authorization_bearer: nil,
                   authorization_token_hash: nil,
                   body: nil,
                   cache_adaptor: nil,
Severity: Major
Found in lib/artirix_data_models/daos/basic_model_dao.rb and 4 other locations - About 1 hr to fix
lib/artirix_data_models/daos/basic_model_dao.rb on lines 175..206
lib/artirix_data_models/daos/basic_model_dao.rb on lines 242..273
lib/artirix_data_models/daos/basic_model_dao.rb on lines 275..305
lib/artirix_data_models/daos/basic_model_dao.rb on lines 307..337

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 67.

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

  def perform_get(path,
                  authorization_bearer: nil,
                  authorization_token_hash: nil,
                  body: nil,
                  cache_adaptor: nil,
Severity: Major
Found in lib/artirix_data_models/daos/basic_model_dao.rb and 4 other locations - About 1 hr to fix
lib/artirix_data_models/daos/basic_model_dao.rb on lines 209..240
lib/artirix_data_models/daos/basic_model_dao.rb on lines 242..273
lib/artirix_data_models/daos/basic_model_dao.rb on lines 275..305
lib/artirix_data_models/daos/basic_model_dao.rb on lines 307..337

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 67.

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

  def perform_delete(path,
                     authorization_bearer: nil,
                     authorization_token_hash: nil,
                     body: nil,
                     cache_adaptor: nil,
Severity: Major
Found in lib/artirix_data_models/daos/basic_model_dao.rb and 4 other locations - About 1 hr to fix
lib/artirix_data_models/daos/basic_model_dao.rb on lines 175..206
lib/artirix_data_models/daos/basic_model_dao.rb on lines 209..240
lib/artirix_data_models/daos/basic_model_dao.rb on lines 242..273
lib/artirix_data_models/daos/basic_model_dao.rb on lines 275..305

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 67.

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

  def perform_patch(path,
                    authorization_bearer: nil,
                    authorization_token_hash: nil,
                    body: nil,
                    cache_adaptor: nil,
Severity: Major
Found in lib/artirix_data_models/daos/basic_model_dao.rb and 4 other locations - About 1 hr to fix
lib/artirix_data_models/daos/basic_model_dao.rb on lines 175..206
lib/artirix_data_models/daos/basic_model_dao.rb on lines 209..240
lib/artirix_data_models/daos/basic_model_dao.rb on lines 242..273
lib/artirix_data_models/daos/basic_model_dao.rb on lines 307..337

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 67.

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

  describe '#get_full' do
    When(:result) { subject.get_full(primary_key) }
    Then { result.is_a? model_class }
    Then { result.primary_key == primary_key }
    Then { result.send(partial_mode_attribute) == partial_mode_attribute_value }
lib/artirix_data_models/spec_support/shared_examples/an_artirix_data_model_dao.rb on lines 64..69

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 34.

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

  describe '#get' do
    When(:result) { subject.get primary_key }
    Then { result.is_a? model_class }
    Then { result.primary_key == primary_key }
    Then { result.send(partial_mode_attribute) == partial_mode_attribute_value }
lib/artirix_data_models/spec_support/shared_examples/an_artirix_data_model_dao.rb on lines 73..78

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 34.

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

    def find(model_pk, cache_adaptor: nil, **extra_options)
      model = adm_registry.get_model model_name, model_pk
      return model if model.present?

      cache_adaptor ||= cache_model_adaptor_for_find(model_pk, **extra_options)
Severity: Minor
Found in lib/artirix_data_models/dao.rb and 1 other location - About 30 mins to fix
lib/artirix_data_models/dao.rb on lines 156..164

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 33.

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

    def get(model_pk, cache_adaptor: nil, **extra_options)
      model = adm_registry.get_model model_name, model_pk
      return model if model.present?

      cache_adaptor ||= cache_model_adaptor_for_get(model_pk, **extra_options)
Severity: Minor
Found in lib/artirix_data_models/dao.rb and 1 other location - About 30 mins to fix
lib/artirix_data_models/dao.rb on lines 167..175

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 33.

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

  def set_persistent_loader(key, loader = nil, &block)
    key = key.to_sym

    if block
      value_to_store = block
Severity: Minor
Found in lib/artirix_data_models/adm_registry.rb and 1 other location - About 25 mins to fix
lib/artirix_data_models/adm_registry.rb on lines 75..86

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 29.

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

  def set_transient_loader(key, loader = nil, &block)
    key = key.to_sym

    if block
      value_to_store = block
Severity: Minor
Found in lib/artirix_data_models/adm_registry.rb and 1 other location - About 25 mins to fix
lib/artirix_data_models/adm_registry.rb on lines 89..100

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 29.

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