tangosource/tangoestimate

View on GitHub
server/components/sockets/main.spec.js

Summary

Maintainability
F
1 wk
Test Coverage

File main.spec.js has 415 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var should = require('should');
var io = require('socket.io-client');
var _ = require('lodash');
Severity: Minor
Found in server/components/sockets/main.spec.js - About 5 hrs to fix

    Identical blocks of code found in 10 locations. Consider refactoring.
    Open

          client1.on('sessionCreated', function(data){
            client1.emit('joinSession', {roomId: data.id, username: 'Tester', type: 'player', sessionType: 'retrospective'});
            client2.emit('joinSession', {roomId: data.id, username: 'Tester2', type: 'player', sessionType: 'retrospective'});
            id = data.id;
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 9 other locations - About 3 hrs to fix
    server/components/sockets/main.spec.js on lines 295..299
    server/components/sockets/main.spec.js on lines 317..321
    server/components/sockets/main.spec.js on lines 362..366
    server/components/sockets/main.spec.js on lines 385..389
    server/components/sockets/main.spec.js on lines 405..409
    server/components/sockets/main.spec.js on lines 424..428
    server/components/sockets/main.spec.js on lines 445..449
    server/components/sockets/main.spec.js on lines 469..473
    server/components/sockets/main.spec.js on lines 491..495

    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

    Identical blocks of code found in 10 locations. Consider refactoring.
    Open

          client1.on('sessionCreated', function(data){
            client1.emit('joinSession', {roomId: data.id, username: 'Tester', type: 'player', sessionType: 'retrospective'});
            client2.emit('joinSession', {roomId: data.id, username: 'Tester2', type: 'player', sessionType: 'retrospective'});
            id = data.id;
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 9 other locations - About 3 hrs to fix
    server/components/sockets/main.spec.js on lines 317..321
    server/components/sockets/main.spec.js on lines 343..347
    server/components/sockets/main.spec.js on lines 362..366
    server/components/sockets/main.spec.js on lines 385..389
    server/components/sockets/main.spec.js on lines 405..409
    server/components/sockets/main.spec.js on lines 424..428
    server/components/sockets/main.spec.js on lines 445..449
    server/components/sockets/main.spec.js on lines 469..473
    server/components/sockets/main.spec.js on lines 491..495

    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

    Identical blocks of code found in 10 locations. Consider refactoring.
    Open

          client1.on('sessionCreated', function(data){
            client1.emit('joinSession', {roomId: data.id, username: 'Tester', type: 'player', sessionType: 'retrospective'});
            client2.emit('joinSession', {roomId: data.id, username: 'Tester2', type: 'player', sessionType: 'retrospective'});
            id = data.id;
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 9 other locations - About 3 hrs to fix
    server/components/sockets/main.spec.js on lines 295..299
    server/components/sockets/main.spec.js on lines 317..321
    server/components/sockets/main.spec.js on lines 343..347
    server/components/sockets/main.spec.js on lines 362..366
    server/components/sockets/main.spec.js on lines 385..389
    server/components/sockets/main.spec.js on lines 405..409
    server/components/sockets/main.spec.js on lines 445..449
    server/components/sockets/main.spec.js on lines 469..473
    server/components/sockets/main.spec.js on lines 491..495

    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

    Identical blocks of code found in 10 locations. Consider refactoring.
    Open

          client1.on('sessionCreated', function(data){
            client1.emit('joinSession', {roomId: data.id, username: 'Tester', type: 'player', sessionType: 'retrospective'});
            client2.emit('joinSession', {roomId: data.id, username: 'Tester2', type: 'player', sessionType: 'retrospective'});
            id = data.id;
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 9 other locations - About 3 hrs to fix
    server/components/sockets/main.spec.js on lines 295..299
    server/components/sockets/main.spec.js on lines 343..347
    server/components/sockets/main.spec.js on lines 362..366
    server/components/sockets/main.spec.js on lines 385..389
    server/components/sockets/main.spec.js on lines 405..409
    server/components/sockets/main.spec.js on lines 424..428
    server/components/sockets/main.spec.js on lines 445..449
    server/components/sockets/main.spec.js on lines 469..473
    server/components/sockets/main.spec.js on lines 491..495

    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

    Identical blocks of code found in 10 locations. Consider refactoring.
    Open

          client1.on('sessionCreated', function(data){
            client1.emit('joinSession', {roomId: data.id, username: 'Tester', type: 'player', sessionType: 'retrospective'});
            client2.emit('joinSession', {roomId: data.id, username: 'Tester2', type: 'player', sessionType: 'retrospective'});
            id = data.id;
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 9 other locations - About 3 hrs to fix
    server/components/sockets/main.spec.js on lines 295..299
    server/components/sockets/main.spec.js on lines 317..321
    server/components/sockets/main.spec.js on lines 343..347
    server/components/sockets/main.spec.js on lines 362..366
    server/components/sockets/main.spec.js on lines 385..389
    server/components/sockets/main.spec.js on lines 405..409
    server/components/sockets/main.spec.js on lines 424..428
    server/components/sockets/main.spec.js on lines 469..473
    server/components/sockets/main.spec.js on lines 491..495

    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

    Identical blocks of code found in 10 locations. Consider refactoring.
    Open

          client1.on('sessionCreated', function(data){
            client1.emit('joinSession', {roomId: data.id, username: 'Tester', type: 'player', sessionType: 'retrospective'});
            client2.emit('joinSession', {roomId: data.id, username: 'Tester2', type: 'player', sessionType: 'retrospective'});
            id = data.id;
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 9 other locations - About 3 hrs to fix
    server/components/sockets/main.spec.js on lines 295..299
    server/components/sockets/main.spec.js on lines 317..321
    server/components/sockets/main.spec.js on lines 343..347
    server/components/sockets/main.spec.js on lines 362..366
    server/components/sockets/main.spec.js on lines 385..389
    server/components/sockets/main.spec.js on lines 405..409
    server/components/sockets/main.spec.js on lines 424..428
    server/components/sockets/main.spec.js on lines 445..449
    server/components/sockets/main.spec.js on lines 469..473

    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

    Identical blocks of code found in 10 locations. Consider refactoring.
    Open

          client1.on('sessionCreated', function(data){
            client1.emit('joinSession', {roomId: data.id, username: 'Tester', type: 'player', sessionType: 'retrospective'});
            client2.emit('joinSession', {roomId: data.id, username: 'Tester2', type: 'player', sessionType: 'retrospective'});
            id = data.id;
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 9 other locations - About 3 hrs to fix
    server/components/sockets/main.spec.js on lines 295..299
    server/components/sockets/main.spec.js on lines 317..321
    server/components/sockets/main.spec.js on lines 343..347
    server/components/sockets/main.spec.js on lines 362..366
    server/components/sockets/main.spec.js on lines 405..409
    server/components/sockets/main.spec.js on lines 424..428
    server/components/sockets/main.spec.js on lines 445..449
    server/components/sockets/main.spec.js on lines 469..473
    server/components/sockets/main.spec.js on lines 491..495

    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

    Identical blocks of code found in 10 locations. Consider refactoring.
    Open

          client1.on('sessionCreated', function(data){
            client1.emit('joinSession', {roomId: data.id, username: 'Tester', type: 'player', sessionType: 'retrospective'});
            client2.emit('joinSession', {roomId: data.id, username: 'Tester2', type: 'player', sessionType: 'retrospective'});
            id = data.id;
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 9 other locations - About 3 hrs to fix
    server/components/sockets/main.spec.js on lines 295..299
    server/components/sockets/main.spec.js on lines 317..321
    server/components/sockets/main.spec.js on lines 343..347
    server/components/sockets/main.spec.js on lines 362..366
    server/components/sockets/main.spec.js on lines 385..389
    server/components/sockets/main.spec.js on lines 405..409
    server/components/sockets/main.spec.js on lines 424..428
    server/components/sockets/main.spec.js on lines 445..449
    server/components/sockets/main.spec.js on lines 491..495

    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

    Identical blocks of code found in 10 locations. Consider refactoring.
    Open

          client1.on('sessionCreated', function(data){
            client1.emit('joinSession', {roomId: data.id, username: 'Tester', type: 'player', sessionType: 'retrospective'});
            client2.emit('joinSession', {roomId: data.id, username: 'Tester2', type: 'player', sessionType: 'retrospective'});
            id = data.id;
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 9 other locations - About 3 hrs to fix
    server/components/sockets/main.spec.js on lines 295..299
    server/components/sockets/main.spec.js on lines 317..321
    server/components/sockets/main.spec.js on lines 343..347
    server/components/sockets/main.spec.js on lines 362..366
    server/components/sockets/main.spec.js on lines 385..389
    server/components/sockets/main.spec.js on lines 424..428
    server/components/sockets/main.spec.js on lines 445..449
    server/components/sockets/main.spec.js on lines 469..473
    server/components/sockets/main.spec.js on lines 491..495

    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

    Identical blocks of code found in 10 locations. Consider refactoring.
    Open

          client1.on('sessionCreated', function(data){
            client1.emit('joinSession', {roomId: data.id, username: 'Tester', type: 'player', sessionType: 'retrospective'});
            client2.emit('joinSession', {roomId: data.id, username: 'Tester2', type: 'player', sessionType: 'retrospective'});
            id = data.id;
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 9 other locations - About 3 hrs to fix
    server/components/sockets/main.spec.js on lines 295..299
    server/components/sockets/main.spec.js on lines 317..321
    server/components/sockets/main.spec.js on lines 343..347
    server/components/sockets/main.spec.js on lines 385..389
    server/components/sockets/main.spec.js on lines 405..409
    server/components/sockets/main.spec.js on lines 424..428
    server/components/sockets/main.spec.js on lines 445..449
    server/components/sockets/main.spec.js on lines 469..473
    server/components/sockets/main.spec.js on lines 491..495

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

            client1.on('updateUsers', function(data){
              data.players[0].username.should.be.exactly('Tester');
              data.players[1].username.should.be.exactly('Another tester');
              done();
            })
    Severity: Major
    Found in server/components/sockets/main.spec.js and 1 other location - About 2 hrs to fix
    server/components/sockets/main.spec.js on lines 100..104

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

    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

              client2.on('updateUsers', function(data){
                data.players[0].username.should.be.exactly('player1');
                data.moderators[0].username.should.be.exactly('moderator1');
                done();
              });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 1 other location - About 2 hrs to fix
    server/components/sockets/main.spec.js on lines 129..133

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

    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('emits an error event when session does not exist on verify session', function(done) {
        client1.emit('verifySession', {id:'not-existing-id'});
    
        client1.on('errorMsg', function(data){
          data.message.should.be.exactly("Session does not exist")
    Severity: Major
    Found in server/components/sockets/main.spec.js and 2 other locations - About 2 hrs to fix
    server/components/sockets/main.spec.js on lines 50..57
    server/components/sockets/main.spec.js on lines 111..118

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

    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('emits an error event when session does not exist', function(done) {
        client1.emit('joinSession', {id:'not-existing-id'});
    
        client1.on('errorMsg', function(data){
          data.message.should.be.exactly("Session does not exist")
    Severity: Major
    Found in server/components/sockets/main.spec.js and 2 other locations - About 2 hrs to fix
    server/components/sockets/main.spec.js on lines 59..66
    server/components/sockets/main.spec.js on lines 111..118

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

    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('sends moderators and players list', function(done) {
        client1.emit('joinSession', {roomId:'not-existing-id'});
    
        client1.on('errorMsg', function(data){
          data.message.should.be.exactly("Session does not exist")
    Severity: Major
    Found in server/components/sockets/main.spec.js and 2 other locations - About 2 hrs to fix
    server/components/sockets/main.spec.js on lines 50..57
    server/components/sockets/main.spec.js on lines 59..66

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

    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

          client1.on('joinedSession', function(data){
            client1.emit('moveCurrentEntry', {id: id, type: 'good', entry:{ id: 0}});
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 2 other locations - About 50 mins to fix
    server/components/sockets/main.spec.js on lines 349..351
    server/components/sockets/main.spec.js on lines 391..393

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

    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

          client1.on('joinedSession', function(data){
            client1.emit('hide', {id: id, type:'good', entry: {id: 0}});
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 2 other locations - About 50 mins to fix
    server/components/sockets/main.spec.js on lines 391..393
    server/components/sockets/main.spec.js on lines 430..432

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

    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

          client1.on('joinedSession', function(data){
            client1.emit('openEntry', {id: id, type:'good', entry: {id: 0}});
          });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 2 other locations - About 50 mins to fix
    server/components/sockets/main.spec.js on lines 349..351
    server/components/sockets/main.spec.js on lines 430..432

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

    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

            client2.on('updateEntries', function(data){
              data.good.length.should.be.exactly(1);
              done();
            });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 2 other locations - About 50 mins to fix
    server/components/sockets/main.spec.js on lines 150..153
    server/components/sockets/main.spec.js on lines 503..506

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

    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

              client1.once('updateUsers', function(data){
                data.players.length.should.be.exactly(1);
                done();
              });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 2 other locations - About 50 mins to fix
    server/components/sockets/main.spec.js on lines 479..482
    server/components/sockets/main.spec.js on lines 503..506

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

    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

                client2.once('updateUsers', function(data){
                  data.players.length.should.be.exactly(1);
                  done();
                });
    Severity: Major
    Found in server/components/sockets/main.spec.js and 2 other locations - About 50 mins to fix
    server/components/sockets/main.spec.js on lines 150..153
    server/components/sockets/main.spec.js on lines 479..482

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

    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

    There are no issues that match your filters.

    Category
    Status