Showing 34 of 40 total issues
Function RoomCtrl
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function RoomCtrl($scope, $http, $window, $document, $timeout, OTSession, RoomService, baseURL, NotificationService) {
$scope.streams = OTSession.streams;
$scope.connections = OTSession.connections;
$scope.publishing = false;
$scope.archiveId = null;
- 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 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function link(scope, element) {
let currentPublisher;
scope.devices = [];
scope.showDeviceList = false;
scope.selectedLabel = '';
Function MicrophonePickerDirective
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function MicrophonePickerDirective() {
function link(scope, element) {
let currentPublisher;
scope.devices = [];
scope.showDeviceList = false;
- 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 toggleFilterList
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
scope.toggleFilterList = () => {
scope.showFilterList = !scope.showFilterList;
setTimeout(() => {
// Do it asynchronously so we don't block
Function mappedStats
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mappedStats = allStats.map((statsContainer) => {
const { stats } = statsContainer;
const key = statsContainer.subscriberId || 'Mantis';
if (!allLastStats[key]) {
Function subscriberStats
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
'$timeout', function subscriberStats(OTSession, StatsService, $timeout) {
return {
restrict: 'E',
scope: {
stream: '=',
Function mutePublisher
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
.directive('mutePublisher', ['OTSession', function mutePublisher(OTSession) {
return {
restrict: 'A',
link(scope, element, attrs) {
const type = attrs.mutedType || 'Video';
Function link
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
link(scope, element, attrs) {
const type = attrs.mutedType || 'Video';
scope[`muted${type}`] = false;
const getPublisher = () =>
Function json
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
json() {
const goToRoom = (err, sessionId, pApiKey, pSecret) => {
if (err) {
console.error('Error getting room: ', err);
res.send({
Function mutePublisher
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
.directive('mutePublisher', ['OTSession', function mutePublisher(OTSession) {
return {
restrict: 'A',
link(scope, element, attrs) {
const type = attrs.mutedType || 'Video';
- 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 filteredPublisher
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function filteredPublisher(OTSession, $rootScope) {
return {
restrict: 'E',
scope: {
props: '&',
- 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 MainCtrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
.controller('MainCtrl', ['$scope', '$window', function MainCtrl($scope, $window) {
$scope.room = '';
$scope.roomType = 'normal';
$scope.advanced = false;
$scope.joinRoom = () => {
- 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 restrictFrameRate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
.directive('restrictFramerate', ['OTSession', function restrictFrameRate(OTSession) {
return {
restrict: 'E',
template: '<button class="restrict-framerate-btn" ng-class="' +
'{\'ion-ios7-speedometer-outline\': restrictedFrameRate, ' +
- 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 draggable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function draggable($document, $window) {
const getEventProp = (event, prop) => {
if (event[prop] === 0) return 0;
return event[prop] || (event.touches && event.touches[0][prop]) ||
(event.originalEvent && event.originalEvent.touches &&
- 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"