Showing 40 of 40 total issues
Function RoomCtrl
has 235 lines of code (exceeds 25 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;
Function exports
has 104 lines of code (exceeds 25 allowed). Consider refactoring. 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
function filteredPublisher(OTSession, $rootScope) {
return {
restrict: 'E',
scope: {
props: '&',
Function PublisherStatsDirective
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PublisherStatsDirective(OTSession, $interval) {
function link(scope) {
let currentPublisher;
const allLastStats = {};
let currentInterval;
Similar blocks of code found in 2 locations. Consider refactoring. Open
document.addEventListener('click', (event) => {
// If they click anywhere outside the picker then hide the list
if (element.find(event.target).length === 0 &&
element.find('ul').find(event.target).length === 0) {
scope.showFilterList = false;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 100.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
document.addEventListener('click', (event) => {
// If they click anywhere outside the picker then hide the list
if (element.find(event.target).length === 0
&& element.find('ul').find(event.target).length === 0) {
scope.showDeviceList = false;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 100.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function link
has 78 lines of code (exceeds 25 allowed). Consider refactoring. 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
function link(scope) {
let currentPublisher;
const allLastStats = {};
let currentInterval;
Function StatsService
has 69 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
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
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
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
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
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
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
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) => {
Similar blocks of code found in 2 locations. Consider refactoring. Open
const whiteboardUpdated = () => {
if (!$scope.showWhiteboard && !$scope.whiteboardUnread) {
// Someone did something to the whiteboard while we weren't looking
$scope.$apply(() => {
$scope.whiteboardUnread = true;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
const editorUpdated = () => {
if (!$scope.showEditor && !$scope.editorUnread) {
// Someone did something to the editor while we weren't looking
$scope.$apply(() => {
$scope.editorUnread = true;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function MicrophonePickerDirective
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MicrophonePickerDirective() {
function link(scope, element) {
let currentPublisher;
scope.devices = [];
scope.showDeviceList = false;