public/telemetry/debug.js
Function Client
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Client: function() {
/**
* Gets the room list associated with the VTC client.
*
* @returns {Array<String>} An array of peerIDs
Function Listener
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
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
Function Listener
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Listener: function() {
this.handlePeerMessage = function(client, peerId, content) {
if (typeof content.opcode === 'string') {
if (content.opcode === 'testP2PConnection' &&
typeof content.id === 'number') {
Function Client
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
Client: function() {
/**
* Gets the room list associated with the VTC client.
*
* @returns {Array<String>} An array of peerIDs
- 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 handlePeerMessage
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.handlePeerMessage = function(client, peerId, content) {
if (typeof content.opcode === 'string') {
if (content.opcode === 'testP2PConnection' &&
typeof content.id === 'number') {
var roomList = DebugConsole._getRoomUserList();
Function getP2PDiagnosticForPeerId
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getP2PDiagnosticForPeerId = function(peerId, completionFn) {
if (peerId === undefined || completionFn === undefined) {
console.log('Usage: \n');
console.log(' Client.getP2PDiagnosticForPeerId(\n');
console.log(' peerId : string,\n');
Function getP2PDiagnostics
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getP2PDiagnostics = function(completionFn) {
if (completionFn === undefined) {
console.log('Usage: \n');
console.log(' Client.getP2PDiagnostics(\n');
console.log(' completionFn : function(Object({\n');