Showing 56 of 226 total issues
Function Chat
has 283 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Chat = function(roomName) {
// @todo (input): make sure that roomName is sanitized
// An Object storing mappings of peerId : String => userName : String
var _peerIdMap = {};
Function Chat
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
var Chat = function(roomName) {
// @todo (input): make sure that roomName is sanitized
// An Object storing mappings of peerId : String => userName : String
var _peerIdMap = {};
- 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 vtcMain
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
var vtcMain = function(params) {
// @todo XXX(debug): If debugging mode is enabled (DebugConsole is a valid function),
// instantiate a new instance of DebugConsole
var dbgListener = null;
if (typeof DebugConsole === 'object' && typeof DebugConsole.Listener === 'function') {
Function Dashboard
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
var Dashboard = function() {
// @todo For hangoutsMode, make the all non-primary video clickable
this.container = null;
this.elem = null;
this.orientation = 0;
- 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 Dashboard
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Dashboard = function() {
// @todo For hangoutsMode, make the all non-primary video clickable
this.container = null;
this.elem = null;
this.orientation = 0;
Function Viewport
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
var Viewport = function(peerName, dashboard) {
// This indicates that the viewport is that of itself
this.isSelf = false;
// @todo In the future, make use of peerName by utilizing it as a label. However,
- 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 Viewport
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Viewport = function(peerName, dashboard) {
// This indicates that the viewport is that of itself
this.isSelf = false;
// @todo In the future, make use of peerName by utilizing it as a label. However,
Function initialize
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function(config) {
var _this = this;
if (typeof config.cameraBtn !== 'object' ||
typeof config.micBtn !== 'object' ||
typeof config.dashBtn !== 'object') {
Function parse
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parse(s, env) {
var chunker = new RegExp([
'(' + CONTROL + ')', // control chars
'(' + BAREWORD + '|' + SINGLE_QUOTE + '|' + DOUBLE_QUOTE + ')*'
].join('|'), 'g');
Function StatefulButton
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
var StatefulButton = function(id, selected) {
var idSel = $(id);
var _kSelectedColor = '#009966';
var _kUnselectedColor = '#cc0033';
var _buttonIsEnabled = true;
File viewports.js
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @file Defines the dashboard and viewport UI components.
*/
'use strict';
Function Client
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Client: function() {
/**
* Gets the room list associated with the VTC client.
*
* @returns {Array<String>} An array of peerIDs
File login.js
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @file This handles the following:
* + Parsing of the query string for a roomName (if it exists)
* + Checking localStorage to determine the following information:
* - Is a userName key set with a valid value? If so, autopopulate the username field with this
Function connect
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
connect: function(userName, roomName, successFn) {
if (!this._validateConfig()) {
ErrorMetric.log('VTCCore.connect => config changed somehow...');
ErrorMetric.log(' => ' + JSON.stringify(this.config));
Function Listener
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Listener: function() {
this.handlePeerMessage = function(client, peerId, content) {
if (typeof content.opcode === 'string') {
if (content.opcode === 'testP2PConnection' &&
typeof content.id === 'number') {
- 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 chat.js
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @file Defines the chat panel UI elements.
*
* @requires Handlebars.js
* @requires module:js/chat-cmds
Function initialize
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.initialize = function(peerId, userName, sendMessageFn) {
var _this = this;
this.peerId = peerId;
this.userName = userName;
Function _toggleCmdExecute
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
var _toggleCmdExecute = function(toggle, name, btn) {
/**
* Changes the a toggle's state.
*
* @param {Object} chatObj - The chat object.
- 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 VTCClient
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
var VTCClient = function(myId, roomName, onErrorFn) {
var _id = myId;
var _room = roomName;
/**
Function StatefulButton
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
var StatefulButton = function(id, selected) {
var idSel = $(id);
var _kSelectedColor = '#009966';
var _kUnselectedColor = '#cc0033';
var _buttonIsEnabled = true;
- 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"