540co/ads-bpa

View on GitHub

Showing 168 of 168 total issues

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

          function(collection_callback){
            console.log('---');
            console.log('Confirm MongoDB collection [' + config.reactions_collection + '] exists');
            db.ensureCollectionExists(config.reactions_collection, function (err, collection) {
              if (err) {
Severity: Major
Found in server/test/routes.js and 1 other location - About 3 hrs to fix
server/test/routes.js on lines 71..83

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

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(collection_callback){
            console.log('---');
            console.log('Confirm MongoDB collection [' + config.searches_collection + '] exists');
            db.ensureCollectionExists(config.searches_collection, function (err, collection) {
              if (err) {
Severity: Major
Found in server/test/routes.js and 1 other location - About 3 hrs to fix
server/test/routes.js on lines 58..70

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

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

    describe('PUT /reactions /definition (reaction = bogus | definitionIndex = 0) - Bad request body (vote value not valid)', function(){

      it('respond with HTTP STATUS CODE 400', function(done){
        request(app)
          .put(baseUrl + '/reactions/bogus/definitions/0')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('PUT /reactions /definition (reaction = bogus | definitionIndex = 0) - Bad request body (vote property not set)', function(){

      it('respond with HTTP STATUS CODE 400', function(done){
        request(app)
          .put(baseUrl + '/reactions/bogus/definitions/0')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('POST /reactions (instance = bogus) - Invalid content-type', function(){

      it('respond with HTTP STATUS CODE 400', function(done){
        request(app)
          .post(baseUrl + '/reactions')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('PUT /reactions /definition (reaction = xxxfoobarxxx | definitionIndex = 0) - Reaction cannot be found', function(){

      it('respond with HTTP STATUS CODE 404', function(done){
        request(app)
          .put(baseUrl + '/reactions/xxxfoobarxxx/definitions/0')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('POST /reactions (reaction = bogus) - Null body', function(){

      it('respond with HTTP STATUS CODE 400', function(done){
        request(app)
          .post(baseUrl + '/reactions')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('PUT /reactions /definition (reaction = bogus | definitionIndex = 1000) - Vote down - not a valid definition index', function(){

      it('respond with HTTP STATUS CODE 404', function(done){
        request(app)
          .put(baseUrl + '/reactions/bogus/definitions/1000')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('PUT /reactions /definition (reaction = bogus | definitionIndex = 0) - Vote up - should be ok', function(){

      it('respond with HTTP STATUS CODE 200', function(done){
        request(app)
          .put(baseUrl + '/reactions/bogus/definitions/0')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('POST /reactions (reaction = bogus) - Duplicate (should be rejected)', function(){

      it('respond with HTTP STATUS CODE 422', function(done){
        request(app)
          .post(baseUrl + '/reactions')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('POST /searches - Bad request body', function(){

      it('respond with HTTP STATUS CODE 400', function(done){
        request(app)
          .post(baseUrl + '/searches')
Severity: Major
Found in server/test/routes.js and 2 other locations - About 3 hrs to fix
server/test/routes.js on lines 640..654
server/test/routes.js on lines 656..670

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

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

    describe('POST /reactions /definition (reaction = bogus | definition = foobar) - Bad content-type', function(){

      it('respond with HTTP STATUS CODE 400', function(done){
        request(app)
          .post(baseUrl + '/reactions/bogus/definitions')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('PUT /reactions /definition (reaction = bogus | definitionIndex = 0) - Bad content-type', function(){

      it('respond with HTTP STATUS CODE 400', function(done){
        request(app)
          .put(baseUrl + '/reactions/bogus/definitions/0')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('POST /reactions (reaction = bogus) - Positive test', function(){

      it('respond with HTTP STATUS CODE 200', function(done){
        request(app)
          .post(baseUrl + '/reactions')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('POST /reactions /definition (reaction = bogus | definition = foobar) - Duplicate definition (should be rejected)', function(){

      it('respond with HTTP STATUS CODE 422', function(done){
        request(app)
          .post(baseUrl + '/reactions/bogus/definitions')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 489..503

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

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

    describe('PUT /reactions /definition (reaction = bogus | definitionIndex = 0) - Vote down - should be ok', function(){

      it('respond with HTTP STATUS CODE 200', function(done){
        request(app)
          .put(baseUrl + '/reactions/bogus/definitions/0')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('POST /reactions /definition (reaction = bogus | definition = foobar) - Bad request body', function(){

      it('respond with HTTP STATUS CODE 400', function(done){
        request(app)
          .post(baseUrl + '/reactions/bogus/definitions')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('POST /reactions /definition (reaction = foobarfoobar | definition = foobar) - Reaction not found / does not exist', function(){

      it('respond with HTTP STATUS CODE 404', function(done){
        request(app)
          .post(baseUrl + '/reactions/foobarfoobar/definitions')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 345..359
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487

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

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

    describe('POST /reactions /definition (reaction = bogus | definition = foobar) - Should be ok', function(){

      it('respond with HTTP STATUS CODE 200', function(done){
        request(app)
          .post(baseUrl + '/reactions/bogus/definitions')
Severity: Major
Found in server/test/routes.js and 15 other locations - About 3 hrs to fix
server/test/routes.js on lines 249..263
server/test/routes.js on lines 265..279
server/test/routes.js on lines 281..295
server/test/routes.js on lines 297..311
server/test/routes.js on lines 313..327
server/test/routes.js on lines 329..343
server/test/routes.js on lines 361..375
server/test/routes.js on lines 377..391
server/test/routes.js on lines 393..407
server/test/routes.js on lines 409..423
server/test/routes.js on lines 425..439
server/test/routes.js on lines 441..455
server/test/routes.js on lines 457..471
server/test/routes.js on lines 473..487
server/test/routes.js on lines 489..503

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

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

    describe('POST /searches (searchterm = vyvanse)', function(){

      it('respond with HTTP STATUS CODE 200', function(done){
        request(app)
          .post(baseUrl + '/searches')
Severity: Major
Found in server/test/routes.js and 2 other locations - About 3 hrs to fix
server/test/routes.js on lines 656..670
server/test/routes.js on lines 672..686

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

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