web/js/jquery.jmri.js

Summary

Maintainability
F
1 mo
Test Coverage

Function JMRI has 1034 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        JMRI: function (url, bindings) {
            var log = new Logger();
            var jmri = new Object();
            if (typeof (url) === 'string') {
                jmri.url = url;
Severity: Major
Found in web/js/jquery.jmri.js - About 5 days to fix

    File jquery.jmri.js has 1040 lines of code (exceeds 300 allowed). Consider refactoring.
    Open

    /**
     * JMRI JSON protocol abstract client.
     *
     * This library depends on jQuery 1.9 or newer.
     *
    Severity: Major
    Found in web/js/jquery.jmri.js - About 2 days to fix

      Function getObject has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  jmri.getObject = function (type, name) {
                      switch (type) {
                          case "audio":
                              jmri.getAudio(name);
                              break;
      Severity: Major
      Found in web/js/jquery.jmri.js - About 3 hrs to fix

        Function reconnect has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    jmri.reconnect = function () {
                        jmri.socket = $.websocket(jmri.url.replace(/^http/, "ws"), {
                            open: function () {
                                jmri.log("Opened WebSocket");
                                jmri.open();
        Severity: Minor
        Found in web/js/jquery.jmri.js - About 1 hr to fix

          Function setObject has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      jmri.setObject = function (type, name, state) {
                          switch (type) {
                              case "light":
                                  jmri.setLight(name, state, 'post');
                                  break;
          Severity: Minor
          Found in web/js/jquery.jmri.js - About 1 hr to fix

            Function message has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                                message: function (e) {
                                    jmri.console(e.originalEvent.data);
                                    //determine message type and call appropriate event handlers
                                    var m = JSON.parse(e.originalEvent.data);
            
            
            Severity: Minor
            Found in web/js/jquery.jmri.js - About 1 hr to fix

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

                          jmri.setIdTag = function (name, state) {
                              if (jmri.socket) {
                                  jmri.socket.send("idTag", { name: name, state: state }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 564..579
              web/js/jquery.jmri.js on lines 589..604

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

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

                          jmri.setOblock = function (name, value) {
                              if (jmri.socket) {
                                  jmri.socket.send("oblock", { name: name, value: value }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 564..579
              web/js/jquery.jmri.js on lines 589..604

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

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

                          jmri.setSignalMast = function (name, state) {
                              if (jmri.socket) {
                                  jmri.socket.send("signalMast", { name: name, state: state }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 564..579

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

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

                          jmri.setMemory = function (name, value) {
                              if (jmri.socket) {
                                  jmri.socket.send("memory", { name: name, value: value }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 564..579
              web/js/jquery.jmri.js on lines 589..604

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

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

                          jmri.setSensor = function (name, state) {
                              if (jmri.socket) {
                                  jmri.socket.send("sensor", { name: name, state: state }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 564..579
              web/js/jquery.jmri.js on lines 589..604

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

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

                          jmri.setSignalHead = function (name, state) {
                              if (jmri.socket) {
                                  jmri.socket.send("signalHead", { name: name, state: state }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 589..604

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

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

                          jmri.setLayoutBlock = function (name, value) {
                              if (jmri.socket) {
                                  jmri.socket.send("layoutBlock", { name: name, value: value }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 564..579
              web/js/jquery.jmri.js on lines 589..604

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

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

                          jmri.setReporter = function (name, value) {
                              if (jmri.socket) {
                                  jmri.socket.send("reporter", { name: name, value: value }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 564..579
              web/js/jquery.jmri.js on lines 589..604

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

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

                          jmri.setRoute = function (name, state) {
                              if (jmri.socket) {
                                  jmri.socket.send("route", { name: name, state: state }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 564..579
              web/js/jquery.jmri.js on lines 589..604

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

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

                          jmri.setAudio = function (name, command) {
                              if (jmri.socket) {
                                  jmri.socket.send("audio", { name: name, command: command }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 564..579
              web/js/jquery.jmri.js on lines 589..604

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

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

                          jmri.setBlock = function (name, value) {
                              if (jmri.socket) {
                                  jmri.socket.send("block", { name: name, value: value }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 359..374
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 564..579
              web/js/jquery.jmri.js on lines 589..604

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

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

                          jmri.setLight = function (name, state) {
                              if (jmri.socket) {
                                  jmri.socket.send("light", { name: name, state: state }, 'post');
                              } else {
                                  $.ajax({
              Severity: Major
              Found in web/js/jquery.jmri.js and 11 other locations - About 1 day to fix
              web/js/jquery.jmri.js on lines 238..253
              web/js/jquery.jmri.js on lines 272..287
              web/js/jquery.jmri.js on lines 309..324
              web/js/jquery.jmri.js on lines 334..349
              web/js/jquery.jmri.js on lines 387..402
              web/js/jquery.jmri.js on lines 415..430
              web/js/jquery.jmri.js on lines 471..486
              web/js/jquery.jmri.js on lines 514..529
              web/js/jquery.jmri.js on lines 539..554
              web/js/jquery.jmri.js on lines 564..579
              web/js/jquery.jmri.js on lines 589..604

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

              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

                          jmri.attemptReconnection = function () {
                              if (jmri.reconnectAttempts < 20) {
                                  jmri.reconnectAttempts++;
                                  jmri.reconnectDelay = 15000 * jmri.reconnectAttempts;
                                  jmri.willReconnect(jmri.reconnectAttempts, jmri.reconnectDelay);
              Severity: Major
              Found in web/js/jquery.jmri.js and 1 other location - About 7 hrs to fix
              web/app/app/websocket.js on lines 410..428

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

              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

                          jmri.connect = function () {
                              // if the JMRI WebSocket was open before we overloaded the
                              // open() method, we call the open() method to ensure it gets
                              // called
                              if (jmri.socket && jmri.socket.readyState === 1) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 1 other location - About 5 hrs to fix
              web/app/app/websocket.js on lines 365..385

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

              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

                          jmri.getMemory = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("memory", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "memory/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 263..271
              web/js/jquery.jmri.js on lines 300..308
              web/js/jquery.jmri.js on lines 325..333
              web/js/jquery.jmri.js on lines 350..358
              web/js/jquery.jmri.js on lines 462..470
              web/js/jquery.jmri.js on lines 505..513
              web/js/jquery.jmri.js on lines 530..538
              web/js/jquery.jmri.js on lines 555..563
              web/js/jquery.jmri.js on lines 580..588
              web/js/jquery.jmri.js on lines 661..669

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

              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

                          jmri.getSignalHead = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("signalHead", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "signalHead/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 263..271
              web/js/jquery.jmri.js on lines 300..308
              web/js/jquery.jmri.js on lines 325..333
              web/js/jquery.jmri.js on lines 350..358
              web/js/jquery.jmri.js on lines 378..386
              web/js/jquery.jmri.js on lines 462..470
              web/js/jquery.jmri.js on lines 505..513
              web/js/jquery.jmri.js on lines 530..538
              web/js/jquery.jmri.js on lines 580..588
              web/js/jquery.jmri.js on lines 661..669

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

              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

                          jmri.getTurnout = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("turnout", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "turnout/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 263..271
              web/js/jquery.jmri.js on lines 300..308
              web/js/jquery.jmri.js on lines 325..333
              web/js/jquery.jmri.js on lines 350..358
              web/js/jquery.jmri.js on lines 378..386
              web/js/jquery.jmri.js on lines 462..470
              web/js/jquery.jmri.js on lines 505..513
              web/js/jquery.jmri.js on lines 530..538
              web/js/jquery.jmri.js on lines 555..563
              web/js/jquery.jmri.js on lines 580..588

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

              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

                          jmri.getReporter = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("reporter", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "reporter/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 263..271
              web/js/jquery.jmri.js on lines 300..308
              web/js/jquery.jmri.js on lines 325..333
              web/js/jquery.jmri.js on lines 350..358
              web/js/jquery.jmri.js on lines 378..386
              web/js/jquery.jmri.js on lines 505..513
              web/js/jquery.jmri.js on lines 530..538
              web/js/jquery.jmri.js on lines 555..563
              web/js/jquery.jmri.js on lines 580..588
              web/js/jquery.jmri.js on lines 661..669

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

              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

                          jmri.getLight = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("light", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "light/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 263..271
              web/js/jquery.jmri.js on lines 300..308
              web/js/jquery.jmri.js on lines 325..333
              web/js/jquery.jmri.js on lines 378..386
              web/js/jquery.jmri.js on lines 462..470
              web/js/jquery.jmri.js on lines 505..513
              web/js/jquery.jmri.js on lines 530..538
              web/js/jquery.jmri.js on lines 555..563
              web/js/jquery.jmri.js on lines 580..588
              web/js/jquery.jmri.js on lines 661..669

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

              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

                          jmri.getSensor = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("sensor", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "sensor/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 263..271
              web/js/jquery.jmri.js on lines 300..308
              web/js/jquery.jmri.js on lines 325..333
              web/js/jquery.jmri.js on lines 350..358
              web/js/jquery.jmri.js on lines 378..386
              web/js/jquery.jmri.js on lines 462..470
              web/js/jquery.jmri.js on lines 505..513
              web/js/jquery.jmri.js on lines 555..563
              web/js/jquery.jmri.js on lines 580..588
              web/js/jquery.jmri.js on lines 661..669

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

              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

                          jmri.getSignalMast = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("signalMast", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "signalMast/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 263..271
              web/js/jquery.jmri.js on lines 300..308
              web/js/jquery.jmri.js on lines 325..333
              web/js/jquery.jmri.js on lines 350..358
              web/js/jquery.jmri.js on lines 378..386
              web/js/jquery.jmri.js on lines 462..470
              web/js/jquery.jmri.js on lines 505..513
              web/js/jquery.jmri.js on lines 530..538
              web/js/jquery.jmri.js on lines 555..563
              web/js/jquery.jmri.js on lines 661..669

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

              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

                          jmri.getBlock = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("block", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "block/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 300..308
              web/js/jquery.jmri.js on lines 325..333
              web/js/jquery.jmri.js on lines 350..358
              web/js/jquery.jmri.js on lines 378..386
              web/js/jquery.jmri.js on lines 462..470
              web/js/jquery.jmri.js on lines 505..513
              web/js/jquery.jmri.js on lines 530..538
              web/js/jquery.jmri.js on lines 555..563
              web/js/jquery.jmri.js on lines 580..588
              web/js/jquery.jmri.js on lines 661..669

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

              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

                          jmri.getLayoutBlock = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("layoutBlock", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "layoutBlock/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 263..271
              web/js/jquery.jmri.js on lines 300..308
              web/js/jquery.jmri.js on lines 350..358
              web/js/jquery.jmri.js on lines 378..386
              web/js/jquery.jmri.js on lines 462..470
              web/js/jquery.jmri.js on lines 505..513
              web/js/jquery.jmri.js on lines 530..538
              web/js/jquery.jmri.js on lines 555..563
              web/js/jquery.jmri.js on lines 580..588
              web/js/jquery.jmri.js on lines 661..669

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

              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

                          jmri.getIdTag = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("idTag", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "idTag/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 263..271
              web/js/jquery.jmri.js on lines 325..333
              web/js/jquery.jmri.js on lines 350..358
              web/js/jquery.jmri.js on lines 378..386
              web/js/jquery.jmri.js on lines 462..470
              web/js/jquery.jmri.js on lines 505..513
              web/js/jquery.jmri.js on lines 530..538
              web/js/jquery.jmri.js on lines 555..563
              web/js/jquery.jmri.js on lines 580..588
              web/js/jquery.jmri.js on lines 661..669

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

              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

                          jmri.getRoute = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("route", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "route/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 10 other locations - About 4 hrs to fix
              web/js/jquery.jmri.js on lines 263..271
              web/js/jquery.jmri.js on lines 300..308
              web/js/jquery.jmri.js on lines 325..333
              web/js/jquery.jmri.js on lines 350..358
              web/js/jquery.jmri.js on lines 378..386
              web/js/jquery.jmri.js on lines 462..470
              web/js/jquery.jmri.js on lines 530..538
              web/js/jquery.jmri.js on lines 555..563
              web/js/jquery.jmri.js on lines 580..588
              web/js/jquery.jmri.js on lines 661..669

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

              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

                          jmri.getRosterGroup = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("rosterGroup", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "rosterGroup/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 2 other locations - About 3 hrs to fix
              web/js/jquery.jmri.js on lines 487..495
              web/js/jquery.jmri.js on lines 652..660

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

              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

                          jmri.getTrain = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("train", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "train/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 2 other locations - About 3 hrs to fix
              web/js/jquery.jmri.js on lines 487..495
              web/js/jquery.jmri.js on lines 496..504

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

              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

                          jmri.getRosterEntry = function (name) {
                              if (jmri.socket) {
                                  jmri.socket.send("rosterEntry", { name: name });
                              } else {
                                  $.getJSON(jmri.url + "rosterEntry/" + name, function (json) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 2 other locations - About 3 hrs to fix
              web/js/jquery.jmri.js on lines 496..504
              web/js/jquery.jmri.js on lines 652..660

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

              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

                          if (typeof (url) === 'string') {
                              jmri.url = url;
                          } else {
                              jmri.url = document.URL.split('/')[0] + "//" + document.URL.split('/')[2] + "/json/";
                              bindings = url;
              Severity: Major
              Found in web/js/jquery.jmri.js and 1 other location - About 3 hrs to fix
              web/js/jquery.jmriConnect.js on lines 19..24

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 92.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                                          if (h) {
                                              h.call(this, m);
                                          } else if (!m.type) {
                                              log.error("ERROR: missing type property in " + m);
                                          } else if (!h) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 1 other location - About 2 hrs to fix
              web/js/jquery.jmri.js on lines 1145..1151

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

              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

                                              if (h) {
                                                  h.call(this, o);
                                              } else if (!o.type) {
                                                  log.error("ERROR: missing type property in " + o);
                                              } else if (!h) {
              Severity: Major
              Found in web/js/jquery.jmri.js and 1 other location - About 2 hrs to fix
              web/js/jquery.jmri.js on lines 1156..1162

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

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

                              layoutBlock: function (e) {
                                  jmri.layoutBlock(e.data.name, e.data.value, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              reporter: function (e) {
                                  jmri.reporter(e.data.name, e.data.value, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              route: function (e) {
                                  jmri.route(e.data.name, e.data.state, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              sensor: function (e) {
                                  jmri.sensor(e.data.name, e.data.state, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              signalMast: function (e) {
                                  jmri.signalMast(e.data.name, e.data.state, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              turnout: function (e) {
                                  jmri.turnout(e.data.name, e.data.state, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062

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

              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

                                  $.getJSON(jmri.url + "audioicon/" + identity, function (json) {
                                      jmri.audioicon(json.data.identity, json.data.command, json.data.playNumLoops);
                                  });
              Severity: Minor
              Found in web/js/jquery.jmri.js and 1 other location - About 40 mins to fix
              web/js/jquery.jmri.js on lines 933..935

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

              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

                              audioicon: function (e) {
                                  jmri.audioicon(e.data.identity, e.data.command, e.data.playNumLoops);
                              },
              Severity: Minor
              Found in web/js/jquery.jmri.js and 1 other location - About 40 mins to fix
              web/js/jquery.jmri.js on lines 258..260

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

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

                              idTag: function (e) {
                                  jmri.idTag(e.data.name, e.data.state, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              signalHead: function (e) {
                                  jmri.signalHead(e.data.name, e.data.state, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              panel: function (e) {
                                  jmri.panel(e.data.name, e.data.value, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              audio: function (e) {
                                  jmri.audio(e.data.name, e.data.state, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              light: function (e) {
                                  jmri.light(e.data.name, e.data.state, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              block: function (e) {
                                  jmri.block(e.data.name, e.data.value, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              memory: function (e) {
                                  jmri.memory(e.data.name, e.data.value, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 1009..1011
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

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

                              oblock: function (e) {
                                  jmri.oblock(e.data.name, e.data.status, e.data);
                              },
              Severity: Major
              Found in web/js/jquery.jmri.js and 13 other locations - About 40 mins to fix
              web/js/jquery.jmri.js on lines 930..932
              web/js/jquery.jmri.js on lines 936..938
              web/js/jquery.jmri.js on lines 966..968
              web/js/jquery.jmri.js on lines 972..974
              web/js/jquery.jmri.js on lines 978..980
              web/js/jquery.jmri.js on lines 994..996
              web/js/jquery.jmri.js on lines 1015..1017
              web/js/jquery.jmri.js on lines 1024..1026
              web/js/jquery.jmri.js on lines 1042..1044
              web/js/jquery.jmri.js on lines 1048..1050
              web/js/jquery.jmri.js on lines 1054..1056
              web/js/jquery.jmri.js on lines 1060..1062
              web/js/jquery.jmri.js on lines 1084..1086

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

              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

                          jmri.heartbeat = function () {
                              jmri.socket.send("ping");
                              jmri.ping();
                          };
              Severity: Minor
              Found in web/js/jquery.jmri.js and 1 other location - About 40 mins to fix
              web/app/app/websocket.js on lines 400..403

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

              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

                          jmri.serialNumber = (Math.random().toString(16) + "000000000").substr(2, 8);
              Severity: Minor
              Found in web/js/jquery.jmri.js and 1 other location - About 35 mins to fix
              web/app/app/websocket.js on lines 388..388

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 42.

              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