Showing 182 of 306 total issues
Function shimAddTrackRemoveTrackWithNative
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
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() {
Function addIceCandidate
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function parseRtpEncodingParameters
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function _gather
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
RTCPeerConnection.prototype._gather = function(mid, sdpMLineIndex) {
var pc = this;
var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer;
if (iceGatherer.onlocalcandidate) {
return;
Function createAnswer
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
RTCPeerConnection.prototype.createAnswer = function() {
var pc = this;
if (this._isClosed) {
return Promise.reject(makeError('InvalidStateError',
Function conferenceUserVideo
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function conferenceUserVideo($modal, currentConferenceState, matchmedia, LOCAL_VIDEO_ID) {
return {
restrict: 'E',
replace: true,
templateUrl: '/views/modules/conference/conference-user-video.html',
Function getCommonCapabilities
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getCommonCapabilities(localCapabilities, remoteCapabilities) {
var commonCapabilities = {
codecs: [],
headerExtensions: [],
fecMechanisms: []
Function shimConstraints_
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var shimConstraints_ = function(constraints, func) {
if (browserDetails.version >= 61) {
return func(constraints);
}
constraints = JSON.parse(JSON.stringify(constraints));
Function exports
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
require('time-grunt')(grunt);
grunt.initConfig({
Function RTCPeerConnection
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var RTCPeerConnection = function(config) {
var pc = this;
var _eventTarget = document.createDocumentFragment();
['addEventListener', 'removeEventListener', 'dispatchEvent']
Function shimOnTrack
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
shimOnTrack: function(window) {
if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in
window.RTCPeerConnection.prototype)) {
Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {
get: function() {
Function getUserMedia_
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getUserMedia_ = function(constraints, onSuccess, onError) {
var constraintsToFF37_ = function(c) {
if (typeof c !== 'object' || c.require) {
return c;
}
Function exports
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(dependencies) {
var wsserver = dependencies('wsserver');
var logger = dependencies('logger');
var pubsub = dependencies('pubsub');
Function scaleToCanvas
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function scaleToCanvas($interval, $window, cropDimensions, drawAvatarIfVideoMuted, drawHelper, currentConferenceState) {
var requestAnimationFrame =
$window.requestAnimationFrame ||
$window.mozRequestAnimationFrame ||
$window.msRequestAnimationFrame ||
Function 8
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function exports
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = dependencies => {
const logger = dependencies('logger');
const config = require('../../core/esn-config');
return {
Function shimCallbacksAPI
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
shimCallbacksAPI: function(window) {
if (typeof window !== 'object' || !window.RTCPeerConnection) {
return;
}
var prototype = window.RTCPeerConnection.prototype;
Function exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = dependencies => {
const logger = dependencies('logger');
const errors = require('../errors')(dependencies);
/**
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function link
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function link(scope) {
var modal = $modal({
scope: scope,
animation: 'am-fade-and-scale',
placement: 'center',
Function smartFit
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function smartFit($rootScope) {
return {
restrict: 'A',
replace: true,
link: link