noppoMan/npdynamodb

View on GitHub

Showing 59 of 74 total issues

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

exports.up = function(migrator, config){
  return migrator().updateTable('test_table1', function(t){
    t.globalSecondaryIndexUpdates(function(t){
      t.create('indexName3', function(t){
        t.string('hash_key2').hashKey();
Severity: Major
Found in test/migrations/20150819155840_alter_test_table1.js and 1 other location - About 5 hrs to fix
test/migrations/20150819155841_alter_test_table1_2.js on lines 3..15

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

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

exports.up = function(migrator, config){
  return migrator().updateTable('test_table1', function(t){
    t.globalSecondaryIndexUpdates(function(t){
      t.create('indexName4', function(t){
        t.string('hash_key3').hashKey();
Severity: Major
Found in test/migrations/20150819155841_alter_test_table1_2.js and 1 other location - About 5 hrs to fix
test/migrations/20150819155840_alter_test_table1.js on lines 3..15

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

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

function expectQueryResult(data, count, startIndex, done){
  expect(data.Count).to.equal(count);
  data.Items.forEach(function(item, i){
    expect(item.hash_key).to.equal('key1');
    expect(item.range_key).to.equal(startIndex+i);
Severity: Major
Found in test/query_builder_read_spec.js and 1 other location - About 3 hrs to fix
test/query_builder_read_spec.js on lines 22..29

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

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

function expectQueryResultMinus(data, count, startIndex, done){
  expect(data.Count).to.equal(count);
  data.Items.forEach(function(item, i){
    expect(item.hash_key).to.equal('key1');
    expect(item.range_key).to.equal(startIndex-i);
Severity: Major
Found in test/query_builder_read_spec.js and 1 other location - About 3 hrs to fix
test/query_builder_read_spec.js on lines 13..20

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

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

    it('Should find rows with filterBeginsWith(gsi_hash_key "hoge")', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .filterBeginsWith('gsi_hash_key', 'hoge')
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 1 other location - About 3 hrs to fix
test/query_builder_read_spec.js on lines 377..388

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

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

    it('Should find rows with filterNotContains(stringSet "foo")', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .filterNotContains('stringSet', "foo")
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 1 other location - About 3 hrs to fix
test/query_builder_read_spec.js on lines 328..339

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

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

    it('Order Should be descending', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .limit(4)
      .desc()
Severity: Major
Found in test/query_builder_read_spec.js and 1 other location - About 3 hrs to fix
test/query_builder_read_spec.js on lines 496..507

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

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

    it('Order Should be ascending', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .limit(4)
      .asc()
Severity: Major
Found in test/query_builder_read_spec.js and 1 other location - About 3 hrs to fix
test/query_builder_read_spec.js on lines 510..521

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

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

    it('Should find rows with filter(range_key <= 3)', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .filter('range_key', '<=', 3)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 9 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 101..111
test/query_builder_read_spec.js on lines 113..123
test/query_builder_read_spec.js on lines 125..135
test/query_builder_read_spec.js on lines 137..147
test/query_builder_read_spec.js on lines 231..241
test/query_builder_read_spec.js on lines 243..253
test/query_builder_read_spec.js on lines 255..265
test/query_builder_read_spec.js on lines 267..277
test/query_builder_read_spec.js on lines 291..301

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

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

    it('Should find rows with where(hash_key=key1 and range_key < 3)', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .where('range_key', '<', 3)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 9 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 101..111
test/query_builder_read_spec.js on lines 113..123
test/query_builder_read_spec.js on lines 125..135
test/query_builder_read_spec.js on lines 231..241
test/query_builder_read_spec.js on lines 243..253
test/query_builder_read_spec.js on lines 255..265
test/query_builder_read_spec.js on lines 267..277
test/query_builder_read_spec.js on lines 279..289
test/query_builder_read_spec.js on lines 291..301

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

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

    it('Should find rows with filter(range_key = 1)', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .filter('range_key', '=', 1)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 9 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 101..111
test/query_builder_read_spec.js on lines 113..123
test/query_builder_read_spec.js on lines 125..135
test/query_builder_read_spec.js on lines 137..147
test/query_builder_read_spec.js on lines 243..253
test/query_builder_read_spec.js on lines 255..265
test/query_builder_read_spec.js on lines 267..277
test/query_builder_read_spec.js on lines 279..289
test/query_builder_read_spec.js on lines 291..301

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

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

    it('Should find rows with filter(range_key >= 8)', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .filter('range_key', '>=', 8)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 9 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 101..111
test/query_builder_read_spec.js on lines 113..123
test/query_builder_read_spec.js on lines 125..135
test/query_builder_read_spec.js on lines 137..147
test/query_builder_read_spec.js on lines 231..241
test/query_builder_read_spec.js on lines 243..253
test/query_builder_read_spec.js on lines 255..265
test/query_builder_read_spec.js on lines 279..289
test/query_builder_read_spec.js on lines 291..301

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

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

    it('Should find rows with where(hash_key=key1 and range_key >= 8)', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .where('range_key', '>=', 8)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 9 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 101..111
test/query_builder_read_spec.js on lines 125..135
test/query_builder_read_spec.js on lines 137..147
test/query_builder_read_spec.js on lines 231..241
test/query_builder_read_spec.js on lines 243..253
test/query_builder_read_spec.js on lines 255..265
test/query_builder_read_spec.js on lines 267..277
test/query_builder_read_spec.js on lines 279..289
test/query_builder_read_spec.js on lines 291..301

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

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

    it('Should find rows with whereBetween', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .whereBetween('range_key', 1, 3)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 2 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 304..314
test/query_builder_read_spec.js on lines 341..351

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

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

    it('Should find rows with filterBetween(range_key 1..5 )', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .filterBetween('range_key', 1, 5)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 2 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 149..159
test/query_builder_read_spec.js on lines 304..314

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

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

    it('Should find rows with filter(range_key > 8)', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .filter('range_key', '>', 8)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 9 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 101..111
test/query_builder_read_spec.js on lines 113..123
test/query_builder_read_spec.js on lines 125..135
test/query_builder_read_spec.js on lines 137..147
test/query_builder_read_spec.js on lines 231..241
test/query_builder_read_spec.js on lines 243..253
test/query_builder_read_spec.js on lines 267..277
test/query_builder_read_spec.js on lines 279..289
test/query_builder_read_spec.js on lines 291..301

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

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

    it('Should find rows with where(hash_key=key1 and range_key > 8)', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .where('range_key', '>', 8)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 9 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 113..123
test/query_builder_read_spec.js on lines 125..135
test/query_builder_read_spec.js on lines 137..147
test/query_builder_read_spec.js on lines 231..241
test/query_builder_read_spec.js on lines 243..253
test/query_builder_read_spec.js on lines 255..265
test/query_builder_read_spec.js on lines 267..277
test/query_builder_read_spec.js on lines 279..289
test/query_builder_read_spec.js on lines 291..301

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

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

    it('Should find rows with where(hash_key=key1 and range_key <= 3)', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .where('range_key', '<=', 3)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 9 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 101..111
test/query_builder_read_spec.js on lines 113..123
test/query_builder_read_spec.js on lines 137..147
test/query_builder_read_spec.js on lines 231..241
test/query_builder_read_spec.js on lines 243..253
test/query_builder_read_spec.js on lines 255..265
test/query_builder_read_spec.js on lines 267..277
test/query_builder_read_spec.js on lines 279..289
test/query_builder_read_spec.js on lines 291..301

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

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

    it('Should find rows with filter(range_key != 1)', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .filter('range_key', '!=', 1)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 9 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 101..111
test/query_builder_read_spec.js on lines 113..123
test/query_builder_read_spec.js on lines 125..135
test/query_builder_read_spec.js on lines 137..147
test/query_builder_read_spec.js on lines 231..241
test/query_builder_read_spec.js on lines 255..265
test/query_builder_read_spec.js on lines 267..277
test/query_builder_read_spec.js on lines 279..289
test/query_builder_read_spec.js on lines 291..301

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

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

    it('Should find rows with filterIn(range_key (1,2))', function(done){
      npd().table('complex_table')
      .where('hash_key', 'key1')
      .filterIn('range_key', 1, 2)
      .then(function(data){
Severity: Major
Found in test/query_builder_read_spec.js and 2 other locations - About 2 hrs to fix
test/query_builder_read_spec.js on lines 149..159
test/query_builder_read_spec.js on lines 341..351

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

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