anilmaurya/bidder

View on GitHub
app/assets/javascripts/pusher.js

Summary

Maintainability
F
1 wk
Test Coverage

File pusher.js has 2600 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Pusher JavaScript Library v2.1.6
 * http://pusherapp.com/
 *
 * Copyright 2013, Pusher
Severity: Major
Found in app/assets/javascripts/pusher.js - About 1 wk to fix

    Function Pusher has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function Pusher(app_key, options) {
        checkAppKey(app_key);
        options = options || {};
    
        var self = this;
    Severity: Major
    Found in app/assets/javascripts/pusher.js - About 2 hrs to fix

      Function connect has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        prototype.connect = function(minPriority, callback) {
          if (!this.isSupported()) {
            return failAttempt(new Pusher.Errors.UnsupportedStrategy(), callback);
          } else if (this.priority < minPriority) {
            return failAttempt(new Pusher.Errors.TransportPriorityTooLow(), callback);
      Severity: Major
      Found in app/assets/javascripts/pusher.js - About 2 hrs to fix

        Function connect has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          prototype.connect = function(minPriority, callback) {
            var self = this;
        
            var strategies = this.strategies;
            var current = 0;
        Severity: Minor
        Found in app/assets/javascripts/pusher.js - About 1 hr to fix

          Function bindListeners has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            prototype.bindListeners = function() {
              var self = this;
          
              var onMessage = function(m) {
                var message;
          Severity: Minor
          Found in app/assets/javascripts/pusher.js - About 1 hr to fix

            Function connect has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              prototype.connect = function(minPriority, callback) {
                var encrypted = this.encrypted;
                var info = fetchTransportCache(encrypted);
            
                var strategies = [this.strategy];
            Severity: Minor
            Found in app/assets/javascripts/pusher.js - About 1 hr to fix

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

                prototype.send = function(id, data, callback) {
                  if (this.script) {
                    return false;
                  }
              
              
              Severity: Minor
              Found in app/assets/javascripts/pusher.js - About 1 hr to fix

                Function getDefaultStrategy has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  Pusher.getDefaultStrategy = function(config) {
                    return [
                      [":def", "ws_options", {
                        hostUnencrypted: config.wsHost + ":" + config.wsPort,
                        hostEncrypted: config.wsHost + ":" + config.wssPort
                Severity: Minor
                Found in app/assets/javascripts/pusher.js - About 1 hr to fix

                  Function ajax has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      ajax: function(socketId, callback){
                        var self = this, xhr;
                  
                        if (Pusher.XHR) {
                          xhr = new Pusher.XHR();
                  Severity: Minor
                  Found in app/assets/javascripts/pusher.js - About 1 hr to fix

                    Function def_transport has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def_transport: function(context, name, type, priority, options, manager) {
                          var transportClass = transports[type];
                          if (!transportClass) {
                            throw new Pusher.Errors.UnsupportedTransport(type);
                          }
                    Severity: Minor
                    Found in app/assets/javascripts/pusher.js - About 1 hr to fix

                      Function tryStrategy has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        prototype.tryStrategy = function(strategy, minPriority, options, callback) {
                          var timer = null;
                          var runner = null;
                      
                          if (options.timeout > 0) {
                      Severity: Minor
                      Found in app/assets/javascripts/pusher.js - About 1 hr to fix

                        Function bindListeners has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          prototype.bindListeners = function() {
                            var self = this;
                        
                            self.onMessage = function(m) {
                              self.unbindListeners();
                        Severity: Minor
                        Found in app/assets/javascripts/pusher.js - About 1 hr to fix

                          Function createConnection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            prototype.createConnection = function(name, priority, key, options) {
                              var self = this;
                          
                              var options = Pusher.Util.extend({}, options, {
                                activityTimeout: self.pingDelay
                          Severity: Minor
                          Found in app/assets/javascripts/pusher.js - About 1 hr to fix

                            Function def_transport has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def_transport: function(context, name, type, priority, options, manager) {
                            Severity: Minor
                            Found in app/assets/javascripts/pusher.js - About 45 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return "backoff";
                              Severity: Major
                              Found in app/assets/javascripts/pusher.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return "refused";
                                Severity: Major
                                Found in app/assets/javascripts/pusher.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return "retry";
                                  Severity: Major
                                  Found in app/assets/javascripts/pusher.js - About 30 mins to fix

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

                                        return {
                                          abort: function() {
                                            runner.abort();
                                          },
                                          forceMinPriority: function(p) {
                                    Severity: Major
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 1 hr to fix
                                    app/assets/javascripts/pusher.js on lines 1393..1403

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

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        return {
                                          abort: function() {
                                            runner.abort();
                                          },
                                          forceMinPriority: function(p) {
                                    Severity: Major
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 1 hr to fix
                                    app/assets/javascripts/pusher.js on lines 1623..1633

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

                                    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 (this.errorScript && this.errorScript.parentNode) {
                                          this.errorScript.parentNode.removeChild(this.errorScript);
                                          this.errorScript = null;
                                        }
                                    Severity: Major
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 1 hr to fix
                                    app/assets/javascripts/pusher.js on lines 1080..1083

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

                                    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 (this.script && this.script.parentNode) {
                                          this.script.parentNode.removeChild(this.script);
                                          this.script = null;
                                        }
                                    Severity: Major
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 1 hr to fix
                                    app/assets/javascripts/pusher.js on lines 1084..1087

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

                                    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

                                      prototype.clearRetryTimer = function() {
                                        if (this.retryTimer) {
                                          this.retryTimer.ensureAborted();
                                          this.retryTimer = null;
                                        }
                                    Severity: Major
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 1 hr to fix
                                    app/assets/javascripts/pusher.js on lines 3049..3054

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

                                    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

                                      prototype.abortConnecting = function() {
                                        if (this.runner) {
                                          this.runner.abort();
                                          this.runner = null;
                                        }
                                    Severity: Major
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 1 hr to fix
                                    app/assets/javascripts/pusher.js on lines 3091..3096

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

                                    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

                                        this.timeline.info(this.buildTimelineMessage({
                                          transport: this.name + (this.options.encrypted ? "s" : "")
                                        }));
                                    Severity: Major
                                    Found in app/assets/javascripts/pusher.js and 2 other locations - About 50 mins to fix
                                    app/assets/javascripts/pusher.js on lines 1866..1868
                                    app/assets/javascripts/pusher.js on lines 2100..2102

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 51.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        this.timeline.info(this.buildTimelineMessage({
                                          transport: this.name + (this.options.encrypted ? "s" : "")
                                        }));
                                    Severity: Major
                                    Found in app/assets/javascripts/pusher.js and 2 other locations - About 50 mins to fix
                                    app/assets/javascripts/pusher.js on lines 2100..2102
                                    app/assets/javascripts/pusher.js on lines 2167..2169

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 51.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                      prototype.ensureAborted = function() {
                                        if (this.timeout) {
                                          clearTimeout(this.timeout);
                                          this.timeout = null;
                                        }
                                    Severity: Minor
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 50 mins to fix
                                    app/assets/javascripts/pusher.js on lines 279..284

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 51.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                      prototype.ensureAborted = function() {
                                        if (this.interval) {
                                          clearInterval(this.interval);
                                          this.interval = null;
                                        }
                                    Severity: Minor
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 50 mins to fix
                                    app/assets/javascripts/pusher.js on lines 243..248

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 51.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        this.timeline.info(this.buildTimelineMessage({
                                          transport: this.name + (this.options.encrypted ? "s" : "")
                                        }));
                                    Severity: Major
                                    Found in app/assets/javascripts/pusher.js and 2 other locations - About 50 mins to fix
                                    app/assets/javascripts/pusher.js on lines 1866..1868
                                    app/assets/javascripts/pusher.js on lines 2167..2169

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 51.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                      prototype.isSupported = function() {
                                        return Pusher.Util.any(this.strategies, Pusher.Util.method("isSupported"));
                                      };
                                    Severity: Minor
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 40 mins to fix
                                    app/assets/javascripts/pusher.js on lines 1269..1271

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

                                    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

                                          [":def", "sockjs_options", {
                                            hostUnencrypted: config.httpHost + ":" + config.httpPort,
                                            hostEncrypted: config.httpHost + ":" + config.httpsPort
                                          }],
                                    Severity: Minor
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 40 mins to fix
                                    app/assets/javascripts/pusher.js on lines 629..632

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

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                      prototype.isSupported = function() {
                                        return Pusher.Util.any(this.strategies, Pusher.Util.method("isSupported"));
                                      };
                                    Severity: Minor
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 40 mins to fix
                                    app/assets/javascripts/pusher.js on lines 1576..1578

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

                                    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

                                          [":def", "ws_options", {
                                            hostUnencrypted: config.wsHost + ":" + config.wsPort,
                                            hostEncrypted: config.wsHost + ":" + config.wssPort
                                          }],
                                    Severity: Minor
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 40 mins to fix
                                    app/assets/javascripts/pusher.js on lines 633..636

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

                                    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

                                      prototype.getQueryString = function() {
                                        return Pusher.AbstractTransport.prototype.getQueryString.call(this) +
                                          "&flash=true";
                                      };
                                    Severity: Minor
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 30 mins to fix
                                    app/assets/javascripts/pusher.js on lines 2266..2269

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

                                    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

                                      prototype.getQueryString = function() {
                                        return Pusher.AbstractTransport.prototype.getQueryString.call(this) +
                                          "&flash=false";
                                      };
                                    Severity: Minor
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 30 mins to fix
                                    app/assets/javascripts/pusher.js on lines 2122..2125

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

                                    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

                                      prototype.clearUnavailableTimer = function() {
                                        if (this.unavailableTimer) {
                                          this.unavailableTimer.ensureAborted();
                                        }
                                      };
                                    Severity: Minor
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 30 mins to fix
                                    app/assets/javascripts/pusher.js on lines 3144..3148

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

                                    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

                                      prototype.stopActivityCheck = function() {
                                        if (this.activityTimer) {
                                          this.activityTimer.ensureAborted();
                                        }
                                      };
                                    Severity: Minor
                                    Found in app/assets/javascripts/pusher.js and 1 other location - About 30 mins to fix
                                    app/assets/javascripts/pusher.js on lines 3110..3114

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

                                    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