Showing 182 of 306 total issues
Function exports
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(dependencies) {
var logger = dependencies('logger');
var 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 webRTCService
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function webRTCService($log, webRTCAdapterRegistry, WEBRTC_CONNECTOR) {
var adapter = webRTCAdapterRegistry.get(WEBRTC_CONNECTOR);
if (!adapter) {
$log.warn(WEBRTC_CONNECTOR, 'webrtc connector has not been found, things will not work as expected');
Function setRemoteDescription
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function conferenceUserControlBar
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function conferenceUserControlBar($log, webRTCService) {
return {
restrict: 'E',
replace: true,
templateUrl: '/views/modules/conference/conference-user-control-bar.html',
Function AutoVideoSwitcher
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function AutoVideoSwitcher($rootScope, $timeout, AUTO_VIDEO_SWITCH_TIMEOUT, LOCAL_VIDEO_ID) {
function AutoVideoSwitcher(conferenceState) {
this.conferenceState = conferenceState;
this.timeouts = {};
Function writeMediaSection
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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(
Function ioInterface
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ioInterface(callback) {
var ioAction = new IoAction();
var terminate = {
emit: emit,
Function userTime
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function userTime(attendeeColorsService, $interval, currentConferenceState, LOCAL_VIDEO_ID, moment) {
return {
restrict: 'A',
link: link
};
Function parseCandidate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SDPUtils.parseCandidate = function(line) {
var parts;
// Parse both variants.
if (line.indexOf('a=candidate:') === 0) {
parts = line.substring(12).split(' ');
Function link
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope) {
function buildUrl(room) {
return URI('/')
.query('')
.fragment('')
Function testRunner
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function testRunner() {
var featureNames;
var feature;
var aliasIdx;
var result;
Function shimSourceObject
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
shimSourceObject: function(window) {
var URL = window && window.URL;
if (typeof window === 'object') {
if (window.HTMLMediaElement &&
Function _transceive
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
RTCPeerConnection.prototype._transceive = function(transceiver,
send, recv) {
var params = getCommonCapabilities(transceiver.localCapabilities,
transceiver.remoteCapabilities);
if (send && transceiver.rtpSender) {
Function conferenceMobileVideo
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function conferenceMobileVideo($timeout, $window, $rootScope, drawVideo, currentConferenceState) {
return {
restrict: 'E',
replace: true,
templateUrl: '/views/modules/conference/conference-mobile-video.html',
Function parseRtpParameters
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SDPUtils.parseRtpParameters = function(mediaSection) {
var description = {
codecs: [],
headerExtensions: [],
fecMechanisms: [],
Function shimCreateOfferLegacy
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
shimCreateOfferLegacy: function(window) {
var origCreateOffer = window.RTCPeerConnection.prototype.createOffer;
window.RTCPeerConnection.prototype.createOffer = function(offerOptions) {
var pc = this;
if (offerOptions) {
Function shimRemoteStreamsAPI
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
shimRemoteStreamsAPI: function(window) {
if (typeof window !== 'object' || !window.RTCPeerConnection) {
return;
}
if (!('getRemoteStreams' in window.RTCPeerConnection.prototype)) {
Function liveConference
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$log,
$timeout,
$interval,
session,
conferenceAPI,
Function addHistory
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addHistory(conference, user, status, callback) {
if (!user) {
return callback(new Error('Undefined user'));
}
Function fileWatcher
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function fileWatcher(logger, file, onChange) {
var watchingConfig = false;
var lastHash = null;
return function fileWatcherInstance() {