benjamine/frame-channels

View on GitHub
public/build/frame-channels.js

Summary

Maintainability
F
3 wks
Test Coverage

File frame-channels.js has 811 lines of code (exceeds 250 allowed). Consider refactoring.
Open

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.frameChannels=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (process){

// global exports

Severity: Major
Found in public/build/frame-channels.js - About 1 day to fix

    Function 14 has 205 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{"es6-promise":3}],14:[function(require,module,exports){
    
    var Promise = require('es6-promise').Promise;
    var ChannelIFrame = require('./channel-iframe');
    var messageCount = 0;
    Severity: Major
    Found in public/build/frame-channels.js - About 1 day to fix

      Function 13 has 170 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{}],13:[function(require,module,exports){
      
      var Promise = require('es6-promise').Promise;
      
      function ChannelIFrame(channel){
      Severity: Major
      Found in public/build/frame-channels.js - About 6 hrs to fix

        Function 8 has 167 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{"./promise":8,"./utils":12}],8:[function(require,module,exports){
        "use strict";
        var config = require("./config").config;
        var configure = require("./config").configure;
        var objectOrFunction = require("./utils").objectOrFunction;
        Severity: Major
        Found in public/build/frame-channels.js - About 6 hrs to fix

          Function ready has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          ChannelIFrame.prototype.ready = function () {
            var self = this;
            var promise = this.readyPromise;
            if (!promise) {
              var channel = this.channel;
          Severity: Major
          Found in public/build/frame-channels.js - About 2 hrs to fix

            Function 2 has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            },{"./channel":14,"_process":2}],2:[function(require,module,exports){
            // shim for using process in browser
            
            var process = module.exports = {};
            
            
            Severity: Minor
            Found in public/build/frame-channels.js - About 2 hrs to fix

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

              },{"./utils":12}],5:[function(require,module,exports){
              (function (process,global){
              "use strict";
              var browserGlobal = (typeof window !== 'undefined') ? window : {};
              var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
              Severity: Minor
              Found in public/build/frame-channels.js - About 1 hr to fix

                Function 4 has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{"./promise/polyfill":7,"./promise/promise":8}],4:[function(require,module,exports){
                "use strict";
                /* global toString */
                
                var isArray = require("./utils").isArray;
                Severity: Minor
                Found in public/build/frame-channels.js - About 1 hr to fix

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

                  function waitMessageResponse(self, id, timeout, resolve, reject) {
                  
                    var _myWindow = self.findMyWindow();
                  
                    var listener = function responseListener(event) {
                  Severity: Minor
                  Found in public/build/frame-channels.js - About 1 hr to fix

                    Function handleThenable has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function handleThenable(promise, value) {
                      var then = null,
                      resolved;
                    
                      try {
                    Severity: Minor
                    Found in public/build/frame-channels.js - About 1 hr to fix

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

                      },{}],7:[function(require,module,exports){
                      (function (global){
                      "use strict";
                      /*global self*/
                      var RSVPPromise = require("./promise").Promise;
                      Severity: Minor
                      Found in public/build/frame-channels.js - About 1 hr to fix

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

                        function all(promises) {
                          /*jshint validthis:true */
                          var Promise = this;
                        
                          if (!isArray(promises)) {
                        Severity: Minor
                        Found in public/build/frame-channels.js - About 1 hr to fix

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

                          process.nextTick = (function () {
                              var canSetImmediate = typeof window !== 'undefined'
                              && window.setImmediate;
                              var canPost = typeof window !== 'undefined'
                              && window.postMessage && window.addEventListener
                          Severity: Minor
                          Found in public/build/frame-channels.js - About 1 hr to fix

                            Function subscribe has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Channel.prototype.subscribe = function (handler) {
                              if (typeof handler !== 'function') {
                                throw new Error('handler function is required');
                              }
                              this.handlers.push(handler);
                            Severity: Minor
                            Found in public/build/frame-channels.js - About 1 hr to fix

                              Function waitMessageResponse has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              function waitMessageResponse(self, id, timeout, resolve, reject) {
                              Severity: Minor
                              Found in public/build/frame-channels.js - About 35 mins to fix

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

                                ChannelIFrame.prototype.ready = function () {
                                  var self = this;
                                  var promise = this.readyPromise;
                                  if (!promise) {
                                    var channel = this.channel;
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 3 days to fix
                                src/channel-iframe.js on lines 8..73

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

                                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

                                ChannelIFrame.prototype.dock = function(location) {
                                  location = location || 'bottom right';
                                  var left = location.indexOf('left') >= 0;
                                  var right = location.indexOf('right') >= 0;
                                  var bottom = location.indexOf('bottom') >= 0;
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 day to fix
                                src/channel-iframe.js on lines 127..150

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

                                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

                                function waitMessageResponse(self, id, timeout, resolve, reject) {
                                
                                  var _myWindow = self.findMyWindow();
                                
                                  var listener = function responseListener(event) {
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 day to fix
                                src/channel.js on lines 57..94

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

                                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

                                ChannelIFrame.prototype.maximize = function() {
                                  var pre = {};
                                  var element = this.element;
                                  element.style.position = 'fixed';
                                  pre.left = element.style.left;
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 day to fix
                                src/channel-iframe.js on lines 152..173

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

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

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

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

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

                                Refactorings

                                Further Reading

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

                                !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.frameChannels=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
                                (function (process){
                                
                                // global exports
                                
                                
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 day to fix
                                public/build/test-bundle.js on lines 1..3324

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

                                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

                                Channel.prototype.subscribe = function (handler) {
                                  if (typeof handler !== 'function') {
                                    throw new Error('handler function is required');
                                  }
                                  this.handlers.push(handler);
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 day to fix
                                src/channel.js on lines 169..197

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

                                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

                                Channel.prototype.findWindow = function () {
                                  if (this._window) {
                                    return this._window;
                                  }
                                  var target = this.options.target;
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 day to fix
                                src/channel.js on lines 34..55

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

                                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

                                ChannelIFrame.prototype.subscribeToPositionMessages = function() {
                                  // let the iframe control it's own position with messages
                                  var iframe = this;
                                  this.channel.subscribe(function(msg, respond) {
                                    if (msg.maximize) {
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 day to fix
                                src/channel-iframe.js on lines 76..102

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

                                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

                                Channel.prototype.push = function(message) {
                                  var msg = message;
                                  if (typeof msg !== 'object') {
                                    msg = { value: msg };
                                  }
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 day to fix
                                src/channel.js on lines 96..119

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

                                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

                                function handleMessage(self, message, handler) {
                                  var respond;
                                  if (message.respond) {
                                    respond = function(response){
                                      var resp = response;
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 7 hrs to fix
                                src/channel.js on lines 144..167

                                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

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

                                function Channel(name, options) {
                                  this.options = options || {};
                                  if (typeof name !== 'string' || name.length < 1) {
                                    throw new Error('name must be a non-empty string');
                                  }
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 5 hrs to fix
                                src/channel.js on lines 6..19

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

                                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

                                ChannelIFrame.prototype.size = function(width, height) {
                                  if (width === '100%' && height === '100%') {
                                    return this.maximize();
                                  }
                                  if (this.preMaximize) {
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 4 hrs to fix
                                src/channel-iframe.js on lines 114..125

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

                                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

                                Channel.prototype.findMyWindow = function () {
                                  if (this._myWindow) {
                                    return this._myWindow;
                                  }
                                  var myWindow = this.options.myWindow;
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 3 hrs to fix
                                src/channel.js on lines 21..32

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

                                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

                                Channel.prototype.originIsAllowed = function (origin) {
                                  var filter = this.options.originFilter;
                                  if (!filter) {
                                    return true;
                                  }
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 3 hrs to fix
                                src/channel.js on lines 130..142

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 103.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                ChannelIFrame.prototype.restore = function() {
                                  var pre = this.preMaximize;
                                  if (!pre) {
                                    return;
                                  }
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 3 hrs to fix
                                src/channel-iframe.js on lines 175..186

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

                                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

                                Channel.prototype.unsubscribe = function (handler) {
                                  for (var i = this.handlers.length - 1; i >= 0; i--) {
                                    if (this.handlers[i] === handler) {
                                      this.handlers.splice(i, 1);
                                    }
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 2 hrs to fix
                                src/channel.js on lines 219..226

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

                                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

                                Channel.prototype.respondToPings = function(){
                                  if (this.respondingToPings) {
                                    return;
                                  }
                                  this.subscribe(function(message, respond){
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 2 hrs to fix
                                src/channel.js on lines 199..208

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

                                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

                                Channel.prototype.request = function(message) {
                                  var msg = message;
                                  if (typeof msg !== 'object') {
                                    msg = { value: msg };
                                  }
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 2 hrs to fix
                                src/channel.js on lines 121..128

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

                                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 (process.browser) {
                                  // exports only for browser bundle
                                  exports.version = '0.0.65';
                                  exports.homepage = 'https://github.com/benjamine/frame-channels';
                                } else {
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 hr to fix
                                src/main.js on lines 10..19

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

                                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

                                Channel.prototype.notifyReady = function () {
                                  this.respondToPings();
                                  try {
                                    this.push({ ready: true });
                                  } catch(err) {
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 hr to fix
                                src/channel.js on lines 210..217

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

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

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

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

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

                                Refactorings

                                Further Reading

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

                                function fulfill(promise, value) {
                                  if (promise._state !== PENDING) { return; }
                                  promise._state = SEALED;
                                  promise._detail = value;
                                
                                
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 hr to fix
                                public/build/frame-channels.js on lines 505..511

                                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

                                function reject(promise, reason) {
                                  if (promise._state !== PENDING) { return; }
                                  promise._state = SEALED;
                                  promise._detail = reason;
                                
                                
                                Severity: Major
                                Found in public/build/frame-channels.js and 1 other location - About 1 hr to fix
                                public/build/frame-channels.js on lines 497..503

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 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

                                There are no issues that match your filters.

                                Category
                                Status