linagora/hublin

View on GitHub
frontend/js/thirdparty/adapter.js

Summary

Maintainability
F
2 mos
Test Coverage

File adapter.js has 3764 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.adapter = f()}})(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){
  /*
   *  Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
   *
   *  Use of this source code is governed by a BSD-style license
Severity: Major
Found in frontend/js/thirdparty/adapter.js - About 1 wk to fix

    Function 1 has 1373 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.adapter = f()}})(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){
      /*
       *  Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
       *
       *  Use of this source code is governed by a BSD-style license
    Severity: Major
    Found in frontend/js/thirdparty/adapter.js - About 6 days to fix

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

        module.exports = function(window, edgeVersion) {
          var RTCPeerConnection = function(config) {
            var pc = this;
      
            var _eventTarget = document.createDocumentFragment();
      Severity: Major
      Found in frontend/js/thirdparty/adapter.js - About 5 days to fix

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

          },{"./chrome/chrome_shim":5,"./common_shim":7,"./edge/edge_shim":8,"./firefox/firefox_shim":10,"./safari/safari_shim":12,"./utils":13}],5:[function(require,module,exports){
        
          /*
           *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
           *
        Severity: Major
        Found in frontend/js/thirdparty/adapter.js - About 3 days to fix

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

            },{"sdp":2}],2:[function(require,module,exports){
             /* eslint-env node */
            'use strict';
          
            // SDP helpers.
          Severity: Major
          Found in frontend/js/thirdparty/adapter.js - About 2 days to fix

            Function setRemoteDescription has 292 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                RTCPeerConnection.prototype.setRemoteDescription = function(description) {
                  var pc = this;
            
                  if (!isActionAllowedInSignalingState('setRemoteDescription',
                      description.type, this.signalingState) || this._isClosed) {
            Severity: Major
            Found in frontend/js/thirdparty/adapter.js - About 1 day to fix

              Function 12 has 266 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                },{"../utils":13}],12:[function(require,module,exports){
                /*
                 *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
                 *
                 *  Use of this source code is governed by a BSD-style license
              Severity: Major
              Found in frontend/js/thirdparty/adapter.js - About 1 day to fix

                Function 6 has 209 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  },{"../utils.js":13,"./getusermedia":6}],6:[function(require,module,exports){
                  /*
                   *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
                   *
                   *  Use of this source code is governed by a BSD-style license
                Severity: Major
                Found in frontend/js/thirdparty/adapter.js - About 1 day to fix

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

                    module.exports = function(window) {
                      var browserDetails = utils.detectBrowser(window);
                      var navigator = window && window.navigator;
                  
                      var constraintsToChrome_ = function(c) {
                  Severity: Major
                  Found in frontend/js/thirdparty/adapter.js - About 1 day to fix

                    Function shimAddTrackRemoveTrack has 199 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        shimAddTrackRemoveTrack: function(window) {
                          var browserDetails = utils.detectBrowser(window);
                          // shim addTrack and removeTrack.
                          if (window.RTCPeerConnection.prototype.addTrack &&
                              browserDetails.version >= 65) {
                    Severity: Major
                    Found in frontend/js/thirdparty/adapter.js - About 7 hrs to fix

                      Function 11 has 183 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        },{"../utils":13,"./getusermedia":11}],11:[function(require,module,exports){
                        /*
                         *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
                         *
                         *  Use of this source code is governed by a BSD-style license
                      Severity: Major
                      Found in frontend/js/thirdparty/adapter.js - About 7 hrs to fix

                        Function 10 has 183 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          },{}],10:[function(require,module,exports){
                          /*
                           *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
                           *
                           *  Use of this source code is governed by a BSD-style license
                        Severity: Major
                        Found in frontend/js/thirdparty/adapter.js - About 7 hrs to fix

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

                            module.exports = function(window) {
                              var browserDetails = utils.detectBrowser(window);
                              var navigator = window && window.navigator;
                              var MediaStreamTrack = window && window.MediaStreamTrack;
                          
                          
                          Severity: Major
                          Found in frontend/js/thirdparty/adapter.js - About 7 hrs to fix

                            Function shimPeerConnection has 157 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                shimPeerConnection: function(window) {
                                  var browserDetails = utils.detectBrowser(window);
                            
                                  // The RTCPeerConnection object.
                                  if (!window.RTCPeerConnection) {
                            Severity: Major
                            Found in frontend/js/thirdparty/adapter.js - About 6 hrs to fix

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

                                },{"../utils.js":13}],7:[function(require,module,exports){
                                /*
                                 *  Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
                                 *
                                 *  Use of this source code is governed by a BSD-style license
                              Severity: Major
                              Found in frontend/js/thirdparty/adapter.js - About 5 hrs to fix

                                Function createOffer has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    RTCPeerConnection.prototype.createOffer = function() {
                                      var pc = this;
                                
                                      if (this._isClosed) {
                                        return Promise.reject(makeError('InvalidStateError',
                                Severity: Major
                                Found in frontend/js/thirdparty/adapter.js - About 5 hrs to fix

                                  Function shimPeerConnection has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      shimPeerConnection: function(window) {
                                        var browserDetails = utils.detectBrowser(window);
                                  
                                        if (typeof window !== 'object' || !(window.RTCPeerConnection ||
                                            window.mozRTCPeerConnection)) {
                                  Severity: Major
                                  Found in frontend/js/thirdparty/adapter.js - About 4 hrs to fix

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

                                      },{"./adapter_factory.js":4}],4:[function(require,module,exports){
                                      /*
                                       *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
                                       *
                                       *  Use of this source code is governed by a BSD-style license
                                    Severity: Major
                                    Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

                                      Function shimGetSendersWithDtmf has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          shimGetSendersWithDtmf: function(window) {
                                            // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack.
                                            if (typeof window === 'object' && window.RTCPeerConnection &&
                                                !('getSenders' in window.RTCPeerConnection.prototype) &&
                                                'createDTMFSender' in window.RTCPeerConnection.prototype) {
                                      Severity: Major
                                      Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

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

                                          module.exports = function(dependencies, opts) {
                                            var window = dependencies && dependencies.window;
                                        
                                            var options = {
                                              shimChrome: true,
                                        Severity: Major
                                        Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

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

                                            },{"../utils":13}],13:[function(require,module,exports){
                                            /*
                                             *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
                                             *
                                             *  Use of this source code is governed by a BSD-style license
                                          Severity: Major
                                          Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

                                            Function setLocalDescription has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                RTCPeerConnection.prototype.setLocalDescription = function(description) {
                                                  var pc = this;
                                            
                                                  if (!isActionAllowedInSignalingState('setLocalDescription',
                                                      description.type, this.signalingState) || this._isClosed) {
                                            Severity: Major
                                            Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

                                              Function shimLocalStreamsAPI has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  shimLocalStreamsAPI: function(window) {
                                                    if (typeof window !== 'object' || !window.RTCPeerConnection) {
                                                      return;
                                                    }
                                                    if (!('getLocalStreams' in window.RTCPeerConnection.prototype)) {
                                              Severity: Major
                                              Found in frontend/js/thirdparty/adapter.js - About 3 hrs to fix

                                                Function parseRtpEncodingParameters has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                  SDPUtils.parseRtpEncodingParameters = function(mediaSection) {
                                                    var encodingParameters = [];
                                                    var description = SDPUtils.parseRtpParameters(mediaSection);
                                                    var hasRed = description.fecMechanisms.indexOf('RED') !== -1;
                                                    var hasUlpfec = description.fecMechanisms.indexOf('ULPFEC') !== -1;
                                                Severity: Major
                                                Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                                                  Function shimAddTrackRemoveTrackWithNative has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      shimAddTrackRemoveTrackWithNative: function(window) {
                                                        // shim addTrack/removeTrack with native variants in order to make
                                                        // the interactions with legacy getLocalStreams behave as in other browsers.
                                                        // Keeps a mapping stream.id => [stream, rtpsenders...]
                                                        window.RTCPeerConnection.prototype.getLocalStreams = function() {
                                                  Severity: Major
                                                  Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                                                    Function addIceCandidate has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        RTCPeerConnection.prototype.addIceCandidate = function(candidate) {
                                                          var sections;
                                                          if (!candidate || candidate.candidate === '') {
                                                            for (var j = 0; j < this.transceivers.length; j++) {
                                                              if (this.transceivers[j].isDatachannel) {
                                                    Severity: Major
                                                    Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                                                      Function createAnswer has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          RTCPeerConnection.prototype.createAnswer = function() {
                                                            var pc = this;
                                                      
                                                            if (this._isClosed) {
                                                              return Promise.reject(makeError('InvalidStateError',
                                                      Severity: Major
                                                      Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                                                        Function _gather has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                            RTCPeerConnection.prototype._gather = function(mid, sdpMLineIndex) {
                                                              var pc = this;
                                                              var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer;
                                                              if (iceGatherer.onlocalcandidate) {
                                                                return;
                                                        Severity: Major
                                                        Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                                                          Function getCommonCapabilities has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                            function getCommonCapabilities(localCapabilities, remoteCapabilities) {
                                                              var commonCapabilities = {
                                                                codecs: [],
                                                                headerExtensions: [],
                                                                fecMechanisms: []
                                                          Severity: Major
                                                          Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                                                            Function shimConstraints_ has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                var shimConstraints_ = function(constraints, func) {
                                                                  if (browserDetails.version >= 61) {
                                                                    return func(constraints);
                                                                  }
                                                                  constraints = JSON.parse(JSON.stringify(constraints));
                                                            Severity: Major
                                                            Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                                                              Function RTCPeerConnection has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                  var RTCPeerConnection = function(config) {
                                                                    var pc = this;
                                                              
                                                                    var _eventTarget = document.createDocumentFragment();
                                                                    ['addEventListener', 'removeEventListener', 'dispatchEvent']
                                                              Severity: Major
                                                              Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                                                                Function shimOnTrack has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                    shimOnTrack: function(window) {
                                                                      if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in
                                                                          window.RTCPeerConnection.prototype)) {
                                                                        Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {
                                                                          get: function() {
                                                                Severity: Major
                                                                Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                                                                  Function getUserMedia_ has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                      var getUserMedia_ = function(constraints, onSuccess, onError) {
                                                                        var constraintsToFF37_ = function(c) {
                                                                          if (typeof c !== 'object' || c.require) {
                                                                            return c;
                                                                          }
                                                                  Severity: Major
                                                                  Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

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

                                                                      },{"./utils":13,"sdp":2}],8:[function(require,module,exports){
                                                                      /*
                                                                       *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
                                                                       *
                                                                       *  Use of this source code is governed by a BSD-style license
                                                                    Severity: Major
                                                                    Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                                                                      Function shimCallbacksAPI has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                          shimCallbacksAPI: function(window) {
                                                                            if (typeof window !== 'object' || !window.RTCPeerConnection) {
                                                                              return;
                                                                            }
                                                                            var prototype = window.RTCPeerConnection.prototype;
                                                                      Severity: Major
                                                                      Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

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

                                                                            var constraintsToChrome_ = function(c) {
                                                                              if (typeof c !== 'object' || c.mandatory || c.optional) {
                                                                                return c;
                                                                              }
                                                                              var cc = {};
                                                                        Severity: Minor
                                                                        Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                window.RTCPeerConnection.prototype.getStats = function(selector,
                                                                                    successCallback, errorCallback) {
                                                                                  var pc = this;
                                                                                  var args = arguments;
                                                                          
                                                                          
                                                                          Severity: Minor
                                                                          Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                            Function wrapPeerConnectionEvent has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                            Open

                                                                              function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) {
                                                                                if (!window.RTCPeerConnection) {
                                                                                  return;
                                                                                }
                                                                                var proto = window.RTCPeerConnection.prototype;
                                                                            Severity: Minor
                                                                            Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                    iceGatherer.onlocalcandidate = function(evt) {
                                                                                      if (pc.usingBundle && sdpMLineIndex > 0) {
                                                                                        // if we know that we use bundle we can drop candidates with
                                                                                        // Ñ•dpMLineIndex > 0. If we don't do this then our state gets
                                                                                        // confused since we dispose the extra ice gatherer.
                                                                              Severity: Minor
                                                                              Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                    detectBrowser: function(window) {
                                                                                      var navigator = window && window.navigator;
                                                                                
                                                                                      // Returned result object.
                                                                                      var result = {};
                                                                                Severity: Minor
                                                                                Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                  Function shimCreateObjectURL has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                  Open

                                                                                      shimCreateObjectURL: function(window) {
                                                                                        var URL = window && window.URL;
                                                                                  
                                                                                        if (!(typeof window === 'object' && window.HTMLMediaElement &&
                                                                                              'srcObject' in window.HTMLMediaElement.prototype &&
                                                                                  Severity: Minor
                                                                                  Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                    Consider simplifying this complex logical expression.
                                                                                    Open

                                                                                          if (server && (server.urls || server.url)) {
                                                                                            var urls = server.urls || server.url;
                                                                                            if (server.url && !server.urls) {
                                                                                              console.warn('RTCIceServer.url is deprecated! Use urls instead.');
                                                                                            }
                                                                                    Severity: Critical
                                                                                    Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                      Function shimPeerConnection has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                      Open

                                                                                          shimPeerConnection: function(window) {
                                                                                            var browserDetails = utils.detectBrowser(window);
                                                                                      
                                                                                            if (window.RTCIceGatherer) {
                                                                                              // ORTC defines an RTCIceCandidate object but no constructor.
                                                                                      Severity: Minor
                                                                                      Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                        Function constraintsToFF37_ has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                        Open

                                                                                              var constraintsToFF37_ = function(c) {
                                                                                                if (typeof c !== 'object' || c.require) {
                                                                                                  return c;
                                                                                                }
                                                                                                var require = [];
                                                                                        Severity: Minor
                                                                                        Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                            SDPUtils.writeMediaSection = function(transceiver, caps, type, stream) {
                                                                                              var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps);
                                                                                          
                                                                                              // Map ICE parameters (ufrag, pwd) to SDP.
                                                                                              sdp += SDPUtils.writeIceParameters(
                                                                                          Severity: Minor
                                                                                          Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                  window.RTCPeerConnection.prototype.addTrack = function(track, stream) {
                                                                                                    var pc = this;
                                                                                                    if (pc.signalingState === 'closed') {
                                                                                                      throw new DOMException(
                                                                                                        'The RTCPeerConnection\'s signalingState is \'closed\'.',
                                                                                            Severity: Minor
                                                                                            Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                              Function setRemoteDescription has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                              Open

                                                                                                      window.RTCPeerConnection.prototype.setRemoteDescription = function() {
                                                                                                        var pc = this;
                                                                                                        if (!pc._ontrackpoly) {
                                                                                                          pc._ontrackpoly = function(e) {
                                                                                                            // onaddstream does not fire when a track is added to an existing
                                                                                              Severity: Minor
                                                                                              Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                                Function writeMediaSection has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                Open

                                                                                                  function writeMediaSection(transceiver, caps, type, stream, dtlsRole) {
                                                                                                    var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps);
                                                                                                
                                                                                                    // Map ICE parameters (ufrag, pwd) to SDP.
                                                                                                    sdp += SDPUtils.writeIceParameters(
                                                                                                Severity: Minor
                                                                                                Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                                  Function parseCandidate has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                    SDPUtils.parseCandidate = function(line) {
                                                                                                      var parts;
                                                                                                      // Parse both variants.
                                                                                                      if (line.indexOf('a=candidate:') === 0) {
                                                                                                        parts = line.substring(12).split(' ');
                                                                                                  Severity: Minor
                                                                                                  Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                        shimSourceObject: function(window) {
                                                                                                          var URL = window && window.URL;
                                                                                                    
                                                                                                          if (typeof window === 'object') {
                                                                                                            if (window.HTMLMediaElement &&
                                                                                                    Severity: Minor
                                                                                                    Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                          RTCPeerConnection.prototype._transceive = function(transceiver,
                                                                                                              send, recv) {
                                                                                                            var params = getCommonCapabilities(transceiver.localCapabilities,
                                                                                                                transceiver.remoteCapabilities);
                                                                                                            if (send && transceiver.rtpSender) {
                                                                                                      Severity: Minor
                                                                                                      Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                          SDPUtils.parseRtpParameters = function(mediaSection) {
                                                                                                            var description = {
                                                                                                              codecs: [],
                                                                                                              headerExtensions: [],
                                                                                                              fecMechanisms: [],
                                                                                                        Severity: Minor
                                                                                                        Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                              shimCreateOfferLegacy: function(window) {
                                                                                                                var origCreateOffer = window.RTCPeerConnection.prototype.createOffer;
                                                                                                                window.RTCPeerConnection.prototype.createOffer = function(offerOptions) {
                                                                                                                  var pc = this;
                                                                                                                  if (offerOptions) {
                                                                                                          Severity: Minor
                                                                                                          Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                                shimRemoteStreamsAPI: function(window) {
                                                                                                                  if (typeof window !== 'object' || !window.RTCPeerConnection) {
                                                                                                                    return;
                                                                                                                  }
                                                                                                                  if (!('getRemoteStreams' in window.RTCPeerConnection.prototype)) {
                                                                                                            Severity: Minor
                                                                                                            Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                                              Function shimRTCIceCandidate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                              Open

                                                                                                                  shimRTCIceCandidate: function(window) {
                                                                                                                    // foundation is arbitrarily chosen as an indicator for full support for
                                                                                                                    // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface
                                                                                                                    if (window.RTCIceCandidate && 'foundation' in
                                                                                                                        window.RTCIceCandidate.prototype) {
                                                                                                              Severity: Minor
                                                                                                              Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                                                Function shimOnTrack has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                Open

                                                                                                                    shimOnTrack: function(window) {
                                                                                                                      if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in
                                                                                                                          window.RTCPeerConnection.prototype)) {
                                                                                                                        Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {
                                                                                                                          get: function() {
                                                                                                                Severity: Minor
                                                                                                                Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                                                  Consider simplifying this complex logical expression.
                                                                                                                  Open

                                                                                                                          if ((face && (face.exact === 'user' || face.exact === 'environment' ||
                                                                                                                                        face.ideal === 'user' || face.ideal === 'environment')) &&
                                                                                                                              !(navigator.mediaDevices.getSupportedConstraints &&
                                                                                                                                navigator.mediaDevices.getSupportedConstraints().facingMode &&
                                                                                                                                !getSupportedFacingModeLies)) {
                                                                                                                  Severity: Critical
                                                                                                                  Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                                          window.RTCPeerConnection.prototype.removeTrack = function(sender) {
                                                                                                                            var pc = this;
                                                                                                                            if (pc.signalingState === 'closed') {
                                                                                                                              throw new DOMException(
                                                                                                                                'The RTCPeerConnection\'s signalingState is \'closed\'.',
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                                          RTCPeerConnection.prototype._updateConnectionState = function() {
                                                                                                                            var newState;
                                                                                                                            var states = {
                                                                                                                              'new': 0,
                                                                                                                              closed: 0,
                                                                                                                      Severity: Minor
                                                                                                                      Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                                                    pc._ontrackpoly = function(e) {
                                                                                                                                      // onaddstream does not fire when a track is added to an existing
                                                                                                                                      // stream. But stream.onaddtrack is implemented so we use that.
                                                                                                                                      e.stream.addEventListener('addtrack', function(te) {
                                                                                                                                        var receiver;
                                                                                                                        Severity: Minor
                                                                                                                        Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                                                window.RTCPeerConnection.prototype.createOffer = function(offerOptions) {
                                                                                                                                  var pc = this;
                                                                                                                                  if (offerOptions) {
                                                                                                                                    var audioTransceiver = pc.getTransceivers().find(function(transceiver) {
                                                                                                                                      return transceiver.sender.track &&
                                                                                                                          Severity: Minor
                                                                                                                          Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                                              SDPUtils.writeRtpDescription = function(kind, caps) {
                                                                                                                                var sdp = '';
                                                                                                                            
                                                                                                                                // Build the mline.
                                                                                                                                sdp += 'm=' + kind + ' ';
                                                                                                                            Severity: Minor
                                                                                                                            Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                                                  RTCPeerConnection.prototype.getStats = function() {
                                                                                                                                    var promises = [];
                                                                                                                                    this.transceivers.forEach(function(transceiver) {
                                                                                                                                      ['rtpSender', 'rtpReceiver', 'iceGatherer', 'iceTransport',
                                                                                                                                          'dtlsTransport'].forEach(function(method) {
                                                                                                                              Severity: Minor
                                                                                                                              Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                                                                Function addTrack has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                    RTCPeerConnection.prototype.addTrack = function(track, stream) {
                                                                                                                                      var alreadyExists = this.transceivers.find(function(s) {
                                                                                                                                        return s.track === track;
                                                                                                                                      });
                                                                                                                                
                                                                                                                                
                                                                                                                                Severity: Minor
                                                                                                                                Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                                                                  Function filterIceServers has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                  Open

                                                                                                                                    function filterIceServers(iceServers, edgeVersion) {
                                                                                                                                      var hasTurn = false;
                                                                                                                                      iceServers = JSON.parse(JSON.stringify(iceServers));
                                                                                                                                      return iceServers.filter(function(server) {
                                                                                                                                        if (server && (server.urls || server.url)) {
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                                                                    Function shimRTCIceServerUrls has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                    Open

                                                                                                                                        shimRTCIceServerUrls: function(window) {
                                                                                                                                          // migrate from non-spec RTCIceServer.url to RTCIceServer.urls
                                                                                                                                          var OrigPeerConnection = window.RTCPeerConnection;
                                                                                                                                          window.RTCPeerConnection = function(pcConfig, pcConstraints) {
                                                                                                                                            if (pcConfig && pcConfig.iceServers) {
                                                                                                                                    Severity: Minor
                                                                                                                                    Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                                                          RTCPeerConnection.prototype._createTransceiver = function(kind) {
                                                                                                                                            var hasBundleTransport = this.transceivers.length > 0;
                                                                                                                                            var transceiver = {
                                                                                                                                              track: null,
                                                                                                                                              iceGatherer: null,
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

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

                                                                                                                                          SDPUtils.writeCandidate = function(candidate) {
                                                                                                                                            var sdp = [];
                                                                                                                                            sdp.push(candidate.foundation);
                                                                                                                                            sdp.push(candidate.component);
                                                                                                                                            sdp.push(candidate.protocol.toUpperCase());
                                                                                                                                        Severity: Minor
                                                                                                                                        Found in frontend/js/thirdparty/adapter.js - About 1 hr to fix

                                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                                          Open

                                                                                                                                                          if (!streams[remoteMsid.stream]) {
                                                                                                                                                            streams[remoteMsid.stream] = new window.MediaStream();
                                                                                                                                                            Object.defineProperty(streams[remoteMsid.stream], 'id', {
                                                                                                                                                              get: function() {
                                                                                                                                                                return remoteMsid.stream;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                                            Open

                                                                                                                                                        if (this.transceivers[i].mid === candidate.sdpMid) {
                                                                                                                                                          sdpMLineIndex = i;
                                                                                                                                                          break;
                                                                                                                                                        }
                                                                                                                                            Severity: Major
                                                                                                                                            Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                                                                                                                                              Avoid deeply nested control flow statements.
                                                                                                                                              Open

                                                                                                                                                              if (!streams.default) {
                                                                                                                                                                streams.default = new window.MediaStream();
                                                                                                                                                              }
                                                                                                                                              Severity: Major
                                                                                                                                              Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                                                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                                                Open

                                                                                                                                                              if (!streams[remoteMsid.stream]) {
                                                                                                                                                                streams[remoteMsid.stream] = new window.MediaStream();
                                                                                                                                                              }
                                                                                                                                                Severity: Major
                                                                                                                                                Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                                  Open

                                                                                                                                                                if (!streams.default) {
                                                                                                                                                                  streams.default = new window.MediaStream();
                                                                                                                                                                }
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                                                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                                                    Open

                                                                                                                                                                if (!maybeAddCandidate(transceiver.iceTransport, cand)) {
                                                                                                                                                                  return Promise.reject(makeError('OperationError',
                                                                                                                                                                      'Can not add ICE candidate'));
                                                                                                                                                                }
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                                                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                                                      Open

                                                                                                                                                                      if (server.hasOwnProperty('urls')) {
                                                                                                                                                                        for (var j = 0; j < server.urls.length; j++) {
                                                                                                                                                                          var newServer = {
                                                                                                                                                                            url: server.urls[j]
                                                                                                                                                                          };
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in frontend/js/thirdparty/adapter.js - About 45 mins to fix

                                                                                                                                                        Consider simplifying this complex logical expression.
                                                                                                                                                        Open

                                                                                                                                                              } else if (typeof window === 'object' && window.RTCPeerConnection &&
                                                                                                                                                                         'getSenders' in window.RTCPeerConnection.prototype &&
                                                                                                                                                                         'createDTMFSender' in window.RTCPeerConnection.prototype &&
                                                                                                                                                                         window.RTCRtpSender &&
                                                                                                                                                                         !('dtmf' in window.RTCRtpSender.prototype)) {
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js - About 40 mins to fix

                                                                                                                                                          Consider simplifying this complex logical expression.
                                                                                                                                                          Open

                                                                                                                                                                if (typeof window === 'object' && window.RTCPeerConnection &&
                                                                                                                                                                    !('getSenders' in window.RTCPeerConnection.prototype) &&
                                                                                                                                                                    'createDTMFSender' in window.RTCPeerConnection.prototype) {
                                                                                                                                                                  var shimSenderWithDtmf = function(pc, track) {
                                                                                                                                                                    return {
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in frontend/js/thirdparty/adapter.js - About 40 mins to fix

                                                                                                                                                            Consider simplifying this complex logical expression.
                                                                                                                                                            Open

                                                                                                                                                                    if ((description.type === 'offer' || description.type === 'answer') &&
                                                                                                                                                                        !rejected && usingBundle && sdpMLineIndex > 0 &&
                                                                                                                                                                        pc.transceivers[sdpMLineIndex]) {
                                                                                                                                                                      pc._disposeIceAndDtlsTransports(sdpMLineIndex);
                                                                                                                                                                      pc.transceivers[sdpMLineIndex].iceGatherer =
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in frontend/js/thirdparty/adapter.js - About 40 mins to fix

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

                                                                                                                                                                function writeMediaSection(transceiver, caps, type, stream, dtlsRole) {
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in frontend/js/thirdparty/adapter.js - About 35 mins to fix

                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                Open

                                                                                                                                                                    return adapter;
                                                                                                                                                                Severity: Major
                                                                                                                                                                Found in frontend/js/thirdparty/adapter.js - About 30 mins to fix

                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                  Open

                                                                                                                                                                                return Promise.reject(makeError('OperationError',
                                                                                                                                                                                    'Can not add ICE candidate'));
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in frontend/js/thirdparty/adapter.js - About 30 mins to fix

                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                    Open

                                                                                                                                                                              return Promise.reject(makeError('OperationError',
                                                                                                                                                                                  'Can not add ICE candidate'));
                                                                                                                                                                    Severity: Major
                                                                                                                                                                    Found in frontend/js/thirdparty/adapter.js - About 30 mins to fix

                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                      Open

                                                                                                                                                                            return Promise.resolve();
                                                                                                                                                                      Severity: Major
                                                                                                                                                                      Found in frontend/js/thirdparty/adapter.js - About 30 mins to fix

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

                                                                                                                                                                            if (transceiver.rtpSender) {
                                                                                                                                                                              // spec.
                                                                                                                                                                              var msid = 'msid:' + stream.id + ' ' +
                                                                                                                                                                                  transceiver.rtpSender.track.id + '\r\n';
                                                                                                                                                                              sdp += 'a=' + msid;
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 day to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 38..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 205.

                                                                                                                                                                        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

                                                                                                                                                                            if (transceiver.rtpSender) {
                                                                                                                                                                              // spec.
                                                                                                                                                                              var msid = 'msid:' + stream.id + ' ' +
                                                                                                                                                                                  transceiver.rtpSender.track.id + '\r\n';
                                                                                                                                                                              sdp += 'a=' + msid;
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 day to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2232..2249

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

                                                                                                                                                                        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 replaceExternalStreamId(pc, description) {
                                                                                                                                                                                var sdp = description.sdp;
                                                                                                                                                                                Object.keys(pc._reverseStreams || []).forEach(function(internalId) {
                                                                                                                                                                                  var externalStream = pc._reverseStreams[internalId];
                                                                                                                                                                                  var internalStream = pc._streams[externalStream.id];
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 4 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2886..2898

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

                                                                                                                                                                        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 replaceInternalStreamId(pc, description) {
                                                                                                                                                                                var sdp = description.sdp;
                                                                                                                                                                                Object.keys(pc._reverseStreams || []).forEach(function(internalId) {
                                                                                                                                                                                  var externalStream = pc._reverseStreams[internalId];
                                                                                                                                                                                  var internalStream = pc._streams[externalStream.id];
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 4 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2899..2911

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

                                                                                                                                                                        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

                                                                                                                                                                              ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']
                                                                                                                                                                                  .forEach(function(method) {
                                                                                                                                                                                    var nativeMethod = window.RTCPeerConnection.prototype[method];
                                                                                                                                                                                    window.RTCPeerConnection.prototype[method] = function() {
                                                                                                                                                                                      arguments[0] = new ((method === 'addIceCandidate') ?
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 4 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 3179..3188

                                                                                                                                                                        Duplicated Code

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

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

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

                                                                                                                                                                        Tuning

                                                                                                                                                                        This issue has a mass of 117.

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

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

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

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

                                                                                                                                                                        Refactorings

                                                                                                                                                                        Further Reading

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

                                                                                                                                                                              ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']
                                                                                                                                                                                  .forEach(function(method) {
                                                                                                                                                                                    var nativeMethod = window.RTCPeerConnection.prototype[method];
                                                                                                                                                                                    window.RTCPeerConnection.prototype[method] = function() {
                                                                                                                                                                                      arguments[0] = new ((method === 'addIceCandidate') ?
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 4 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 3857..3866

                                                                                                                                                                        Duplicated Code

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

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

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

                                                                                                                                                                        Tuning

                                                                                                                                                                        This issue has a mass of 117.

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

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

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

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

                                                                                                                                                                        Refactorings

                                                                                                                                                                        Further Reading

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

                                                                                                                                                                                  if (offerOptions.offerToReceiveAudio === false && audioTransceiver) {
                                                                                                                                                                                    if (audioTransceiver.direction === 'sendrecv') {
                                                                                                                                                                                      audioTransceiver.setDirection('sendonly');
                                                                                                                                                                                    } else if (audioTransceiver.direction === 'recvonly') {
                                                                                                                                                                                      audioTransceiver.setDirection('inactive');
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 3 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4438..4447

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

                                                                                                                                                                        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 (offerOptions.offerToReceiveVideo === false && videoTransceiver) {
                                                                                                                                                                                    if (videoTransceiver.direction === 'sendrecv') {
                                                                                                                                                                                      videoTransceiver.setDirection('sendonly');
                                                                                                                                                                                    } else if (videoTransceiver.direction === 'recvonly') {
                                                                                                                                                                                      videoTransceiver.setDirection('inactive');
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 3 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4423..4432

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

                                                                                                                                                                        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.createOffer = function(successCallback, failureCallback) {
                                                                                                                                                                                var options = (arguments.length >= 2) ? arguments[2] : arguments[0];
                                                                                                                                                                                var promise = createOffer.apply(this, [options]);
                                                                                                                                                                                if (!failureCallback) {
                                                                                                                                                                                  return promise;
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 3 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4311..4319

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

                                                                                                                                                                        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.createAnswer = function(successCallback, failureCallback) {
                                                                                                                                                                                var options = (arguments.length >= 2) ? arguments[2] : arguments[0];
                                                                                                                                                                                var promise = createAnswer.apply(this, [options]);
                                                                                                                                                                                if (!failureCallback) {
                                                                                                                                                                                  return promise;
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 3 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4301..4309

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

                                                                                                                                                                        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

                                                                                                                                                                              window.RTCPeerConnection.prototype.addIceCandidate = function() {
                                                                                                                                                                                if (!arguments[0]) {
                                                                                                                                                                                  if (arguments[1]) {
                                                                                                                                                                                    arguments[1].apply(null);
                                                                                                                                                                                  }
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 3193..3201

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

                                                                                                                                                                        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

                                                                                                                                                                              window.RTCPeerConnection.prototype.addIceCandidate = function() {
                                                                                                                                                                                if (!arguments[0]) {
                                                                                                                                                                                  if (arguments[1]) {
                                                                                                                                                                                    arguments[1].apply(null);
                                                                                                                                                                                  }
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 3871..3879

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

                                                                                                                                                                        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

                                                                                                                                                                                stream.getTracks().forEach(function(track) {
                                                                                                                                                                                  var alreadyExists = pc.getSenders().find(function(s) {
                                                                                                                                                                                    return s.track === track;
                                                                                                                                                                                  });
                                                                                                                                                                                  if (alreadyExists) {
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2799..2807

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

                                                                                                                                                                        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

                                                                                                                                                                                stream.getTracks().forEach(function(track) {
                                                                                                                                                                                  var alreadyExists = pc.getSenders().find(function(s) {
                                                                                                                                                                                    return s.track === track;
                                                                                                                                                                                  });
                                                                                                                                                                                  if (alreadyExists) {
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2729..2737

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

                                                                                                                                                                        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 (offerOptions.offerToReceiveVideo !== undefined) {
                                                                                                                                                                                  if (offerOptions.offerToReceiveVideo === true) {
                                                                                                                                                                                    numVideoTracks = 1;
                                                                                                                                                                                  } else if (offerOptions.offerToReceiveVideo === false) {
                                                                                                                                                                                    numVideoTracks = 0;
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 1273..1281

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

                                                                                                                                                                        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

                                                                                                                                                                            if (transceiver.rtpSender && transceiver.rtpReceiver) {
                                                                                                                                                                              sdp += 'a=sendrecv\r\n';
                                                                                                                                                                            } else if (transceiver.rtpSender) {
                                                                                                                                                                              sdp += 'a=sendonly\r\n';
                                                                                                                                                                            } else if (transceiver.rtpReceiver) {
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2222..2230

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

                                                                                                                                                                        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 (offerOptions.offerToReceiveAudio !== undefined) {
                                                                                                                                                                                  if (offerOptions.offerToReceiveAudio === true) {
                                                                                                                                                                                    numAudioTracks = 1;
                                                                                                                                                                                  } else if (offerOptions.offerToReceiveAudio === false) {
                                                                                                                                                                                    numAudioTracks = 0;
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 1282..1290

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

                                                                                                                                                                        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

                                                                                                                                                                            } else if (transceiver.rtpSender && transceiver.rtpReceiver) {
                                                                                                                                                                              sdp += 'a=sendrecv\r\n';
                                                                                                                                                                            } else if (transceiver.rtpSender) {
                                                                                                                                                                              sdp += 'a=sendonly\r\n';
                                                                                                                                                                            } else if (transceiver.rtpReceiver) {
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 28..36

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

                                                                                                                                                                        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

                                                                                                                                                                            RTCPeerConnection.prototype.getReceivers = function() {
                                                                                                                                                                              return this.transceivers.filter(function(transceiver) {
                                                                                                                                                                                return !!transceiver.rtpReceiver;
                                                                                                                                                                              })
                                                                                                                                                                              .map(function(transceiver) {
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 508..515

                                                                                                                                                                        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

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

                                                                                                                                                                            RTCPeerConnection.prototype.getSenders = function() {
                                                                                                                                                                              return this.transceivers.filter(function(transceiver) {
                                                                                                                                                                                return !!transceiver.rtpSender;
                                                                                                                                                                              })
                                                                                                                                                                              .map(function(transceiver) {
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 517..524

                                                                                                                                                                        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

                                                                                                                                                                            if (transceiver.rtpSender && transceiver.sendEncodingParameters[0].rtx) {
                                                                                                                                                                              sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc +
                                                                                                                                                                                  ' cname:' + SDPUtils.localCName + '\r\n';
                                                                                                                                                                            }
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 59..62

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

                                                                                                                                                                        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

                                                                                                                                                                            if (transceiver.rtpSender && transceiver.sendEncodingParameters[0].rtx) {
                                                                                                                                                                              sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc +
                                                                                                                                                                                  ' cname:' + SDPUtils.localCName + '\r\n';
                                                                                                                                                                            }
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2253..2256

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

                                                                                                                                                                        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

                                                                                                                                                                              withCallback = function(description, successCallback, failureCallback) {
                                                                                                                                                                                var promise = setRemoteDescription.apply(this, [description]);
                                                                                                                                                                                if (!failureCallback) {
                                                                                                                                                                                  return promise;
                                                                                                                                                                                }
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4341..4348

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

                                                                                                                                                                        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

                                                                                                                                                                              withCallback = function(candidate, successCallback, failureCallback) {
                                                                                                                                                                                var promise = addIceCandidate.apply(this, [candidate]);
                                                                                                                                                                                if (!failureCallback) {
                                                                                                                                                                                  return promise;
                                                                                                                                                                                }
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4331..4338

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

                                                                                                                                                                        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 (!isActionAllowedInSignalingState('setRemoteDescription',
                                                                                                                                                                                  description.type, this.signalingState) || this._isClosed) {
                                                                                                                                                                                return Promise.reject(makeError('InvalidStateError',
                                                                                                                                                                                    'Can not set remote ' + description.type +
                                                                                                                                                                                    ' in state ' + pc.signalingState));
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 730..735

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

                                                                                                                                                                        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 (!isActionAllowedInSignalingState('setLocalDescription',
                                                                                                                                                                                  description.type, this.signalingState) || this._isClosed) {
                                                                                                                                                                                return Promise.reject(makeError('InvalidStateError',
                                                                                                                                                                                    'Can not set local ' + description.type +
                                                                                                                                                                                    ' in state ' + pc.signalingState));
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 824..829

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

                                                                                                                                                                        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

                                                                                                                                                                            var planB = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:')
                                                                                                                                                                            .map(function(line) {
                                                                                                                                                                              return SDPUtils.parseSsrcMedia(line);
                                                                                                                                                                            })
                                                                                                                                                                            .filter(function(parts) {
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2057..2063

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

                                                                                                                                                                        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

                                                                                                                                                                            var ssrcs = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:')
                                                                                                                                                                            .map(function(line) {
                                                                                                                                                                              return SDPUtils.parseSsrcMedia(line);
                                                                                                                                                                            })
                                                                                                                                                                            .filter(function(parts) {
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2166..2172

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

                                                                                                                                                                        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

                                                                                                                                                                              switch (description.type) {
                                                                                                                                                                                case 'offer':
                                                                                                                                                                                  this._updateSignalingState('have-local-offer');
                                                                                                                                                                                  break;
                                                                                                                                                                                case 'answer':
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 1101..1111

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

                                                                                                                                                                        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

                                                                                                                                                                                      stream.addEventListener('removetrack', function() {
                                                                                                                                                                                        if (self.src) {
                                                                                                                                                                                          URL.revokeObjectURL(self.src);
                                                                                                                                                                                        }
                                                                                                                                                                                        self.src = URL.createObjectURL(stream);
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2678..2683

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

                                                                                                                                                                        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

                                                                                                                                                                                      stream.addEventListener('addtrack', function() {
                                                                                                                                                                                        if (self.src) {
                                                                                                                                                                                          URL.revokeObjectURL(self.src);
                                                                                                                                                                                        }
                                                                                                                                                                                        self.src = URL.createObjectURL(stream);
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 2684..2689

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

                                                                                                                                                                        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

                                                                                                                                                                              switch (description.type) {
                                                                                                                                                                                case 'offer':
                                                                                                                                                                                  this._updateSignalingState('have-remote-offer');
                                                                                                                                                                                  break;
                                                                                                                                                                                case 'answer':
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 806..816

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

                                                                                                                                                                        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

                                                                                                                                                                                var remap = function(obj, a, b) {
                                                                                                                                                                                  if (a in obj && !(b in obj)) {
                                                                                                                                                                                    obj[b] = obj[a];
                                                                                                                                                                                    delete obj[a];
                                                                                                                                                                                  }
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4112..4117

                                                                                                                                                                        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

                                                                                                                                                                              var remap = function(obj, a, b) {
                                                                                                                                                                                if (a in obj && !(b in obj)) {
                                                                                                                                                                                  obj[b] = obj[a];
                                                                                                                                                                                  delete obj[a];
                                                                                                                                                                                }
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 3280..3285

                                                                                                                                                                        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

                                                                                                                                                                                  var audioTransceiver = pc.getTransceivers().find(function(transceiver) {
                                                                                                                                                                                    return transceiver.sender.track &&
                                                                                                                                                                                        transceiver.sender.track.kind === 'audio';
                                                                                                                                                                                  });
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4434..4437

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

                                                                                                                                                                        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

                                                                                                                                                                                  var videoTransceiver = pc.getTransceivers().find(function(transceiver) {
                                                                                                                                                                                    return transceiver.sender.track &&
                                                                                                                                                                                        transceiver.sender.track.kind === 'video';
                                                                                                                                                                                  });
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4419..4422

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

                                                                                                                                                                        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 (window.webkitRTCPeerConnection.generateCertificate) {
                                                                                                                                                                                  Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', {
                                                                                                                                                                                    get: function() {
                                                                                                                                                                                      return window.webkitRTCPeerConnection.generateCertificate;
                                                                                                                                                                                    }
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 3844..3850

                                                                                                                                                                        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

                                                                                                                                                                                if (window.mozRTCPeerConnection.generateCertificate) {
                                                                                                                                                                                  Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', {
                                                                                                                                                                                    get: function() {
                                                                                                                                                                                      return window.mozRTCPeerConnection.generateCertificate;
                                                                                                                                                                                    }
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 1 hr to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 3030..3036

                                                                                                                                                                        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

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

                                                                                                                                                                                  if (edgeVersion < 15019) {
                                                                                                                                                                                    localCapabilities.codecs = localCapabilities.codecs.filter(
                                                                                                                                                                                        function(codec) {
                                                                                                                                                                                          return codec.name !== 'rtx';
                                                                                                                                                                                        });
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 55 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 1337..1342

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

                                                                                                                                                                        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._remoteStreams) {
                                                                                                                                                                                    this._remoteStreams.forEach(function(stream) {
                                                                                                                                                                                      if (stream.id === id) {
                                                                                                                                                                                        result = stream;
                                                                                                                                                                                      }
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 55 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4190..4196

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

                                                                                                                                                                        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._localStreams) {
                                                                                                                                                                                    this._localStreams.forEach(function(stream) {
                                                                                                                                                                                      if (stream.id === id) {
                                                                                                                                                                                        result = stream;
                                                                                                                                                                                      }
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 55 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4197..4203

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

                                                                                                                                                                        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

                                                                                                                                                                                if (edgeVersion < 15019) {
                                                                                                                                                                                  localCapabilities.codecs = localCapabilities.codecs.filter(
                                                                                                                                                                                      function(codec) {
                                                                                                                                                                                        return codec.name !== 'rtx';
                                                                                                                                                                                      });
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 55 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 954..959

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

                                                                                                                                                                        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 (pc.transceivers[sdpMLineIndex].rtpSender) {
                                                                                                                                                                                    pc.transceivers[sdpMLineIndex].rtpSender.setTransport(
                                                                                                                                                                                        pc.transceivers[0].dtlsTransport);
                                                                                                                                                                                  }
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 55 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 925..928

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

                                                                                                                                                                        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 (pc.transceivers[sdpMLineIndex].rtpReceiver) {
                                                                                                                                                                                    pc.transceivers[sdpMLineIndex].rtpReceiver.setTransport(
                                                                                                                                                                                        pc.transceivers[0].dtlsTransport);
                                                                                                                                                                                  }
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 55 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 921..924

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

                                                                                                                                                                        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

                                                                                                                                                                              if (this.usingBundle) {
                                                                                                                                                                                sdp += 'a=group:BUNDLE ' + this.transceivers.map(function(t) {
                                                                                                                                                                                  return t.mid;
                                                                                                                                                                                }).join(' ') + '\r\n';
                                                                                                                                                                              }
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 50 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 1376..1380

                                                                                                                                                                        Duplicated Code

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

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

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

                                                                                                                                                                        Tuning

                                                                                                                                                                        This issue has a mass of 52.

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

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

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

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

                                                                                                                                                                        Refactorings

                                                                                                                                                                        Further Reading

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

                                                                                                                                                                              if (this._config.bundlePolicy !== 'max-compat') {
                                                                                                                                                                                sdp += 'a=group:BUNDLE ' + this.transceivers.map(function(t) {
                                                                                                                                                                                  return t.mid;
                                                                                                                                                                                }).join(' ') + '\r\n';
                                                                                                                                                                              }
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 50 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 1418..1422

                                                                                                                                                                        Duplicated Code

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

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

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

                                                                                                                                                                        Tuning

                                                                                                                                                                        This issue has a mass of 52.

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

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

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

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

                                                                                                                                                                        Refactorings

                                                                                                                                                                        Further Reading

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

                                                                                                                                                                          function removeTrackFromStreamAndFireEvent(track, stream) {
                                                                                                                                                                            stream.removeTrack(track);
                                                                                                                                                                            var e = new Event('removetrack'); // TODO: MediaStreamTrackEvent
                                                                                                                                                                            e.track = track;
                                                                                                                                                                            stream.dispatchEvent(e);
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 50 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 219..224

                                                                                                                                                                        Duplicated Code

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

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

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

                                                                                                                                                                        Tuning

                                                                                                                                                                        This issue has a mass of 52.

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

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

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

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

                                                                                                                                                                        Refactorings

                                                                                                                                                                        Further Reading

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

                                                                                                                                                                          function addTrackToStreamAndFireEvent(track, stream) {
                                                                                                                                                                            stream.addTrack(track);
                                                                                                                                                                            var e = new Event('addtrack'); // TODO: MediaStreamTrackEvent
                                                                                                                                                                            e.track = track;
                                                                                                                                                                            stream.dispatchEvent(e);
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 50 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 226..231

                                                                                                                                                                        Duplicated Code

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

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

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

                                                                                                                                                                        Tuning

                                                                                                                                                                        This issue has a mass of 52.

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

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

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

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

                                                                                                                                                                        Refactorings

                                                                                                                                                                        Further Reading

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

                                                                                                                                                                              if (typeof window === 'object' && window.RTCPeerConnection &&
                                                                                                                                                                                  ('receiver' in window.RTCTrackEvent.prototype) &&
                                                                                                                                                                                  // can't check 'transceiver' in window.RTCTrackEvent.prototype, as it is
                                                                                                                                                                                  // defined for some reason even when window.RTCTransceiver is not.
                                                                                                                                                                                  !window.RTCTransceiver) {
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 40 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 3774..3782

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

                                                                                                                                                                        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

                                                                                                                                                                              if (typeof window === 'object' && window.RTCTrackEvent &&
                                                                                                                                                                                  ('receiver' in window.RTCTrackEvent.prototype) &&
                                                                                                                                                                                  !('transceiver' in window.RTCTrackEvent.prototype)) {
                                                                                                                                                                                Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', {
                                                                                                                                                                                  get: function() {
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 40 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4401..4411

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

                                                                                                                                                                        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

                                                                                                                                                                                    if (c.audio && !stream.getAudioTracks().length ||
                                                                                                                                                                                        c.video && !stream.getVideoTracks().length) {
                                                                                                                                                                                      stream.getTracks().forEach(function(track) {
                                                                                                                                                                                        track.stop();
                                                                                                                                                                                      });
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 40 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 4096..4103

                                                                                                                                                                        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

                                                                                                                                                                                  if (c.audio && !stream.getAudioTracks().length ||
                                                                                                                                                                                      c.video && !stream.getVideoTracks().length) {
                                                                                                                                                                                    stream.getTracks().forEach(function(track) {
                                                                                                                                                                                      track.stop();
                                                                                                                                                                                    });
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 40 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 3418..3424

                                                                                                                                                                        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

                                                                                                                                                                              usernameFragment: lines.filter(function(line) {
                                                                                                                                                                                return line.indexOf('a=ice-ufrag:') === 0;
                                                                                                                                                                              })[0].substr(12),
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 35 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 1950..1952

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

                                                                                                                                                                        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

                                                                                                                                                                              password: lines.filter(function(line) {
                                                                                                                                                                                return line.indexOf('a=ice-pwd:') === 0;
                                                                                                                                                                              })[0].substr(10)
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 35 mins to fix
                                                                                                                                                                        frontend/js/thirdparty/adapter.js on lines 1947..1949

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

                                                                                                                                                                        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