Showing 34 of 40 total issues
Function RoomCtrl
has 235 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function exports
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app, config, redis, ot) => {
const RoomStore = roomstore(redis, ot);
// Keeping this around for legacy URLs. The new URL format for
// archives is /:room/archive/:archiveId though
Function filteredPublisher
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function filteredPublisher(OTSession, $rootScope) {
return {
restrict: 'E',
scope: {
props: '&',
Function PublisherStatsDirective
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PublisherStatsDirective(OTSession, $interval) {
function link(scope) {
let currentPublisher;
const allLastStats = {};
let currentInterval;
Function link
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link(scope, element, attrs) {
const props = angular.copy(scope.props() || {});
props.mirror = true;
props.resolution = '640x480';
Function link
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function link(scope) {
let currentPublisher;
const allLastStats = {};
let currentInterval;
Function StatsService
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function StatsService($interval) {
let interval;
const subscribers = {}; // A collection of SubscriberStats objects keyed by subscriber.id
const updateStats = () => {
Object.keys(subscribers).forEach((subscriberId) => {
Function draggable
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 &&
Function FilterPickerDirective
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FilterPickerDirective() {
function link(scope, element) {
let currentPublisher;
scope.showFilterList = false;
scope.filters = ['none', 'brannan', 'xpro2', 'moon', 'nashville', 'lofi', 'helena', '1977'];
Function exports
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (redis, ot) => {
const roomStore = {
isP2P(room) {
return room.toLowerCase().indexOf('p2p') >= 0;
},
Function exports
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app, config, redis, ot, redirectSSL) => {
const RoomStore = roomstore(redis, ot);
app.get('*', (req, res, next) => {
if (req.host === 'hangout.tokbox.com') {
res.redirect(`https://meet.tokbox.com${req.url}`);
Function controller
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
controller: ['$scope', 'chromeExtensionId', function controller($scope, chromeExtensionId) {
$scope.promptToInstall = false;
$scope.selectingScreenSource = false;
$scope.sharingMyScreen = false;
$scope.screenShareSupported = true;
Function link
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function link(scope, element) {
let currentPublisher;
scope.showFilterList = false;
scope.filters = ['none', 'brannan', 'xpro2', 'moon', 'nashville', 'lofi', 'helena', '1977'];
scope.filterImages = null;
Function updateStats
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateStats() {
const hasPublisher = currentPublisher != null;
const hasGetStats = currentPublisher && typeof currentPublisher.getStats === 'function';
if (!hasPublisher || !hasGetStats) {
Function getRoom
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getRoom(room, apiKey, secret) {
console.log(`getRoom: ${room} ${apiKey} ${secret}`);
const goToRoom = arguments[arguments.length - 1]; // eslint-disable-line
// Lookup the mapping of rooms to sessionIds
redis.hget('rooms', room, (err, sid) => {
Function MicrophonePickerDirective
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function MicrophonePickerDirective() {
function link(scope, element) {
let currentPublisher;
scope.devices = [];
scope.showDeviceList = false;
Function updateStats
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const updateStats = () => {
Object.keys(subscribers).forEach((subscriberId) => {
const subscriberStats = subscribers[subscriberId];
const { subscriber, lastStats, lastLastStats } = subscriberStats;
subscriber.getStats((err, stats) => {
Function NotificationService
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
function NotificationService($window, OTSession, Push) {
let focused = true;
$window.addEventListener('blur', () => {
focused = 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 PublisherStatsDirective
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
function PublisherStatsDirective(OTSession, $interval) {
function link(scope) {
let currentPublisher;
const allLastStats = {};
let currentInterval;
- 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 NotificationService
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function NotificationService($window, OTSession, Push) {
let focused = true;
$window.addEventListener('blur', () => {
focused = false;