Showing 182 of 306 total issues
File adapter.js
has 3764 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
Function 1
has 1373 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function exports
has 1183 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(window, edgeVersion) {
var RTCPeerConnection = function(config) {
var pc = this;
var _eventTarget = document.createDocumentFragment();
Function 5
has 626 lines of code (exceeds 25 allowed). Consider refactoring. Open
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.
*
Function 2
has 502 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"sdp":2}],2:[function(require,module,exports){
/* eslint-env node */
'use strict';
// SDP helpers.
Function exports
has 310 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
var testArgs = (function() {
var opts = ['test', 'chunk'];
var args = {};
opts.forEach(function(optName) {
Function setRemoteDescription
has 292 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
RTCPeerConnection.prototype.setRemoteDescription = function(description) {
var pc = this;
if (!isActionAllowedInSignalingState('setRemoteDescription',
description.type, this.signalingState) || this._isClosed) {
Function 12
has 266 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function exports
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = dependencies => {
const logger = dependencies('logger');
const errors = require('../errors')(dependencies);
/**
Function 6
has 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function exports
has 205 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(window) {
var browserDetails = utils.detectBrowser(window);
var navigator = window && window.navigator;
var constraintsToChrome_ = function(c) {
Function shimAddTrackRemoveTrack
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
shimAddTrackRemoveTrack: function(window) {
var browserDetails = utils.detectBrowser(window);
// shim addTrack and removeTrack.
if (window.RTCPeerConnection.prototype.addTrack &&
browserDetails.version >= 65) {
Function 11
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function 10
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function exports
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(window) {
var browserDetails = utils.detectBrowser(window);
var navigator = window && window.navigator;
var MediaStreamTrack = window && window.MediaStreamTrack;
Function start
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
Open
function start(callback) {
function listenCallback(server, err) {
if (server === webserver.server) { states.http4 = STARTED; }
if (server === webserver.sslserver) { states.ssl4 = STARTED; }
if (server === webserver.server6) { states.http6 = STARTED; }
- 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
File services.js
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
angular.module('op.websocket')
.factory('IoAction', ['$timeout', function($timeout) {
function getNgCallback(callback) {
Function shimPeerConnection
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
shimPeerConnection: function(window) {
var browserDetails = utils.detectBrowser(window);
// The RTCPeerConnection object.
if (!window.RTCPeerConnection) {
File index.js
has 419 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
const extend = require('extend');
const q = require('q');
const async = require('async');
Function exports
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(dependencies) {
var logger = dependencies('logger');
var errors = require('../errors')(dependencies);
const denormalizer = require('../denormalizers/conference')(dependencies);