pb10001/utakata-umigame

View on GitHub

Showing 77 of 77 total issues

Function exports has 363 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(socket) {
  user_id += 1;
  socket.user_id = user_id;
  sockets.push(socket);
  socket.on('join', function(roomName) {
Severity: Major
Found in socket.js - About 1 day to fix

    Function exports has 350 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(socket) {
      user_id += 1;
      socket.user_id = user_id;
      sockets.push(socket);
      socket.on('join', function(roomName) {
    Severity: Major
    Found in socket-legacy.js - About 1 day to fix

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

        socket.on('privateChatMessage', function(msg) {
          console.log(msg.to);
          var sendTo =
            sockets.filter(function(elem) {
              return elem.user_id == msg.to;
      Severity: Major
      Found in socket.js and 1 other location - About 1 day to fix
      socket-legacy.js on lines 248..276

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

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

        socket.on('privateChatMessage', function(msg) {
          console.log(msg.to);
          var sendTo =
            sockets.filter(function(elem) {
              return elem.user_id == msg.to;
      Severity: Major
      Found in socket-legacy.js and 1 other location - About 1 day to fix
      socket.js on lines 233..261

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

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

          client.hgetall(chatKey, function(err, doc) {
            chatMessages = [];
            for (var key in doc) {
              var msg = JSON.parse(doc[key]);
              msg.name = msg.sent_from + ' → ' + msg.sent_to;
      Severity: Major
      Found in socket.js and 1 other location - About 7 hrs to fix
      socket-legacy.js on lines 35..50

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

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

          client.hgetall(chatKey, function(err, doc) {
            chatMessages = [];
            for (var key in doc) {
              var msg = JSON.parse(doc[key]);
              msg.name = msg.sent_from + ' → ' + msg.sent_to;
      Severity: Major
      Found in socket-legacy.js and 1 other location - About 7 hrs to fix
      socket.js on lines 33..48

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

      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

        socket.on('fetchLobby', function() {
          client.hgetall('lobbyChats', function(err, docs) {
            lobbyChats = [];
            for (var key in docs) {
              var msg = JSON.parse(docs[key]);
      Severity: Major
      Found in socket.js and 1 other location - About 7 hrs to fix
      socket-legacy.js on lines 82..97

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

      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

        socket.on('fetchLobby', function() {
          client.hgetall('lobbyChats', function(err, docs) {
            lobbyChats = [];
            for (var key in docs) {
              var msg = JSON.parse(docs[key]);
      Severity: Major
      Found in socket-legacy.js and 1 other location - About 7 hrs to fix
      socket.js on lines 78..93

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

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

      describe('PrivacyPolicyComponent', () => {
        let component: PrivacyPolicyComponent;
        let fixture: ComponentFixture<PrivacyPolicyComponent>;
      
        beforeEach(async(() => {
      client-beta/src/app/answer-editor/answer-editor.component.spec.ts on lines 5..25
      client-beta/src/app/chat-box/chat-box.component.spec.ts on lines 5..25
      client-beta/src/app/config/config.component.spec.ts on lines 5..25
      client-beta/src/app/editor/editor.component.spec.ts on lines 5..25
      client-beta/src/app/link/link.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-chat/lobby-chat.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-editor/lobby-editor.component.spec.ts on lines 5..25
      client-beta/src/app/lobby/lobby.component.spec.ts on lines 5..25
      client-beta/src/app/mondai-editor/mondai-editor.component.spec.ts on lines 5..25
      client-beta/src/app/mondai/mondai.component.spec.ts on lines 5..25

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

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

      describe('EditorComponent', () => {
        let component: EditorComponent;
        let fixture: ComponentFixture<EditorComponent>;
      
        beforeEach(async(() => {
      Severity: Major
      Found in client-beta/src/app/editor/editor.component.spec.ts and 10 other locations - About 6 hrs to fix
      client-beta/src/app/answer-editor/answer-editor.component.spec.ts on lines 5..25
      client-beta/src/app/chat-box/chat-box.component.spec.ts on lines 5..25
      client-beta/src/app/config/config.component.spec.ts on lines 5..25
      client-beta/src/app/link/link.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-chat/lobby-chat.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-editor/lobby-editor.component.spec.ts on lines 5..25
      client-beta/src/app/lobby/lobby.component.spec.ts on lines 5..25
      client-beta/src/app/mondai-editor/mondai-editor.component.spec.ts on lines 5..25
      client-beta/src/app/mondai/mondai.component.spec.ts on lines 5..25
      client-beta/src/app/privacy-policy/privacy-policy.component.spec.ts on lines 5..25

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

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

      describe('LinkComponent', () => {
        let component: LinkComponent;
        let fixture: ComponentFixture<LinkComponent>;
      
        beforeEach(async(() => {
      Severity: Major
      Found in client-beta/src/app/link/link.component.spec.ts and 10 other locations - About 6 hrs to fix
      client-beta/src/app/answer-editor/answer-editor.component.spec.ts on lines 5..25
      client-beta/src/app/chat-box/chat-box.component.spec.ts on lines 5..25
      client-beta/src/app/config/config.component.spec.ts on lines 5..25
      client-beta/src/app/editor/editor.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-chat/lobby-chat.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-editor/lobby-editor.component.spec.ts on lines 5..25
      client-beta/src/app/lobby/lobby.component.spec.ts on lines 5..25
      client-beta/src/app/mondai-editor/mondai-editor.component.spec.ts on lines 5..25
      client-beta/src/app/mondai/mondai.component.spec.ts on lines 5..25
      client-beta/src/app/privacy-policy/privacy-policy.component.spec.ts on lines 5..25

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

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

      describe('ConfigComponent', () => {
        let component: ConfigComponent;
        let fixture: ComponentFixture<ConfigComponent>;
      
        beforeEach(async(() => {
      Severity: Major
      Found in client-beta/src/app/config/config.component.spec.ts and 10 other locations - About 6 hrs to fix
      client-beta/src/app/answer-editor/answer-editor.component.spec.ts on lines 5..25
      client-beta/src/app/chat-box/chat-box.component.spec.ts on lines 5..25
      client-beta/src/app/editor/editor.component.spec.ts on lines 5..25
      client-beta/src/app/link/link.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-chat/lobby-chat.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-editor/lobby-editor.component.spec.ts on lines 5..25
      client-beta/src/app/lobby/lobby.component.spec.ts on lines 5..25
      client-beta/src/app/mondai-editor/mondai-editor.component.spec.ts on lines 5..25
      client-beta/src/app/mondai/mondai.component.spec.ts on lines 5..25
      client-beta/src/app/privacy-policy/privacy-policy.component.spec.ts on lines 5..25

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

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

      describe('MondaiEditorComponent', () => {
        let component: MondaiEditorComponent;
        let fixture: ComponentFixture<MondaiEditorComponent>;
      
        beforeEach(async(() => {
      client-beta/src/app/answer-editor/answer-editor.component.spec.ts on lines 5..25
      client-beta/src/app/chat-box/chat-box.component.spec.ts on lines 5..25
      client-beta/src/app/config/config.component.spec.ts on lines 5..25
      client-beta/src/app/editor/editor.component.spec.ts on lines 5..25
      client-beta/src/app/link/link.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-chat/lobby-chat.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-editor/lobby-editor.component.spec.ts on lines 5..25
      client-beta/src/app/lobby/lobby.component.spec.ts on lines 5..25
      client-beta/src/app/mondai/mondai.component.spec.ts on lines 5..25
      client-beta/src/app/privacy-policy/privacy-policy.component.spec.ts on lines 5..25

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

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

      describe('MondaiComponent', () => {
        let component: MondaiComponent;
        let fixture: ComponentFixture<MondaiComponent>;
      
        beforeEach(async(() => {
      Severity: Major
      Found in client-beta/src/app/mondai/mondai.component.spec.ts and 10 other locations - About 6 hrs to fix
      client-beta/src/app/answer-editor/answer-editor.component.spec.ts on lines 5..25
      client-beta/src/app/chat-box/chat-box.component.spec.ts on lines 5..25
      client-beta/src/app/config/config.component.spec.ts on lines 5..25
      client-beta/src/app/editor/editor.component.spec.ts on lines 5..25
      client-beta/src/app/link/link.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-chat/lobby-chat.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-editor/lobby-editor.component.spec.ts on lines 5..25
      client-beta/src/app/lobby/lobby.component.spec.ts on lines 5..25
      client-beta/src/app/mondai-editor/mondai-editor.component.spec.ts on lines 5..25
      client-beta/src/app/privacy-policy/privacy-policy.component.spec.ts on lines 5..25

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

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

      describe('AnswerEditorComponent', () => {
        let component: AnswerEditorComponent;
        let fixture: ComponentFixture<AnswerEditorComponent>;
      
        beforeEach(async(() => {
      client-beta/src/app/chat-box/chat-box.component.spec.ts on lines 5..25
      client-beta/src/app/config/config.component.spec.ts on lines 5..25
      client-beta/src/app/editor/editor.component.spec.ts on lines 5..25
      client-beta/src/app/link/link.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-chat/lobby-chat.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-editor/lobby-editor.component.spec.ts on lines 5..25
      client-beta/src/app/lobby/lobby.component.spec.ts on lines 5..25
      client-beta/src/app/mondai-editor/mondai-editor.component.spec.ts on lines 5..25
      client-beta/src/app/mondai/mondai.component.spec.ts on lines 5..25
      client-beta/src/app/privacy-policy/privacy-policy.component.spec.ts on lines 5..25

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

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

      describe('LobbyChatComponent', () => {
        let component: LobbyChatComponent;
        let fixture: ComponentFixture<LobbyChatComponent>;
      
        beforeEach(async(() => {
      client-beta/src/app/answer-editor/answer-editor.component.spec.ts on lines 5..25
      client-beta/src/app/chat-box/chat-box.component.spec.ts on lines 5..25
      client-beta/src/app/config/config.component.spec.ts on lines 5..25
      client-beta/src/app/editor/editor.component.spec.ts on lines 5..25
      client-beta/src/app/link/link.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-editor/lobby-editor.component.spec.ts on lines 5..25
      client-beta/src/app/lobby/lobby.component.spec.ts on lines 5..25
      client-beta/src/app/mondai-editor/mondai-editor.component.spec.ts on lines 5..25
      client-beta/src/app/mondai/mondai.component.spec.ts on lines 5..25
      client-beta/src/app/privacy-policy/privacy-policy.component.spec.ts on lines 5..25

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

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

      describe('LobbyComponent', () => {
        let component: LobbyComponent;
        let fixture: ComponentFixture<LobbyComponent>;
      
        beforeEach(async(() => {
      Severity: Major
      Found in client-beta/src/app/lobby/lobby.component.spec.ts and 10 other locations - About 6 hrs to fix
      client-beta/src/app/answer-editor/answer-editor.component.spec.ts on lines 5..25
      client-beta/src/app/chat-box/chat-box.component.spec.ts on lines 5..25
      client-beta/src/app/config/config.component.spec.ts on lines 5..25
      client-beta/src/app/editor/editor.component.spec.ts on lines 5..25
      client-beta/src/app/link/link.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-chat/lobby-chat.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-editor/lobby-editor.component.spec.ts on lines 5..25
      client-beta/src/app/mondai-editor/mondai-editor.component.spec.ts on lines 5..25
      client-beta/src/app/mondai/mondai.component.spec.ts on lines 5..25
      client-beta/src/app/privacy-policy/privacy-policy.component.spec.ts on lines 5..25

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

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

      describe('LobbyEditorComponent', () => {
        let component: LobbyEditorComponent;
        let fixture: ComponentFixture<LobbyEditorComponent>;
      
        beforeEach(async(() => {
      client-beta/src/app/answer-editor/answer-editor.component.spec.ts on lines 5..25
      client-beta/src/app/chat-box/chat-box.component.spec.ts on lines 5..25
      client-beta/src/app/config/config.component.spec.ts on lines 5..25
      client-beta/src/app/editor/editor.component.spec.ts on lines 5..25
      client-beta/src/app/link/link.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-chat/lobby-chat.component.spec.ts on lines 5..25
      client-beta/src/app/lobby/lobby.component.spec.ts on lines 5..25
      client-beta/src/app/mondai-editor/mondai-editor.component.spec.ts on lines 5..25
      client-beta/src/app/mondai/mondai.component.spec.ts on lines 5..25
      client-beta/src/app/privacy-policy/privacy-policy.component.spec.ts on lines 5..25

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

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

      describe('ChatBoxComponent', () => {
        let component: ChatBoxComponent;
        let fixture: ComponentFixture<ChatBoxComponent>;
      
        beforeEach(async(() => {
      Severity: Major
      Found in client-beta/src/app/chat-box/chat-box.component.spec.ts and 10 other locations - About 6 hrs to fix
      client-beta/src/app/answer-editor/answer-editor.component.spec.ts on lines 5..25
      client-beta/src/app/config/config.component.spec.ts on lines 5..25
      client-beta/src/app/editor/editor.component.spec.ts on lines 5..25
      client-beta/src/app/link/link.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-chat/lobby-chat.component.spec.ts on lines 5..25
      client-beta/src/app/lobby-editor/lobby-editor.component.spec.ts on lines 5..25
      client-beta/src/app/lobby/lobby.component.spec.ts on lines 5..25
      client-beta/src/app/mondai-editor/mondai-editor.component.spec.ts on lines 5..25
      client-beta/src/app/mondai/mondai.component.spec.ts on lines 5..25
      client-beta/src/app/privacy-policy/privacy-policy.component.spec.ts on lines 5..25

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

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

          client.hgetall(questionKey, function(err, doc) {
            messages = {};
            for (var key in doc) {
              messages[key] = JSON.parse(doc[key]);
            }
      Severity: Major
      Found in socket.js and 1 other location - About 5 hrs to fix
      socket-legacy.js on lines 51..64

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

      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