Showing 143 of 4,295 total issues
Function ChatProxy
has a Cognitive Complexity of 268 (exceeds 5 allowed). Consider refactoring. Open
function ChatProxy(service) {
var self = this;
var originSendFunction;
self.webrtcSignalingProcessor = 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
File qbChat.js
has 1779 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/** JSHint inline rules */
/* globals Strophe, $pres, $msg, $iq */
File qbWebRTCSession.js
has 887 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/**
* QuickBlox JavaScript SDK
* WebRTC Module (WebRTC session model)
File quickblox.d.ts
has 819 lines of code (exceeds 250 allowed). Consider refactoring. Open
type Dictionary<T> = Record<string, T>;
type RequiredProps<T, K extends keyof T> = T & Required<Pick<T, K>>;
declare enum QBChatProtocol {
Function ChatProxy
has 387 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ChatProxy(service) {
var self = this;
var originSendFunction;
self.webrtcSignalingProcessor = null;
File qbRTCPeerConnection.js
has 578 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/**
* QuickBlox JavaScript SDK
* WebRTC Module (WebRTC peer connection model)
Function parseExtraParams
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
parseExtraParams: function(extraParams) {
var self = this;
if (!extraParams) {
return 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 ajax
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
ajax: function(params, callback) {
if (this._fetchingSettings) {
this._queue.push([params, callback]);
return;
- 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 connect
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
connect: function (params, callback) {
/**
* This callback Returns error or contact list.
* @callback chatConnectCallback
* @param {Object} error - The error object
Function ajax
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
ajax: function(params, callback) {
if (this._fetchingSettings) {
this._queue.push([params, callback]);
return;
Function _onPresence
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
this._onPresence = function (stanza) {
var from = chatUtils.getAttr(stanza, 'from'),
to = chatUtils.getAttr(stanza, 'to'),
id = chatUtils.getAttr(stanza, 'id'),
type = chatUtils.getAttr(stanza, 'type'),
Function create
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: function (list, callback) {
/**
* Callback for QB.chat.privacylist.create().
* @param {Object} error - The error object
* @callback createPrivacylistCallback
Consider simplifying this complex logical expression. Open
if (error || (statusCode !== 200 && statusCode !== 201 && statusCode !== 202)) {
var errorMsg;
try {
errorMsg = {
Function WebRTCSignalingProcessor
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
function WebRTCSignalingProcessor(service, delegate) {
var self = this;
self.service = service;
self.delegate = delegate;
Function _getStats
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _getStats(peer, lastResults, successCallback, errorCallback) {
var statistic = {
'local': {
'audio': {},
'video': {},
Function WebRTCSignalingProcessor
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function WebRTCSignalingProcessor(service, delegate) {
var self = this;
self.service = service;
self.delegate = delegate;
- 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 findLineInRange
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function findLineInRange(
sdpLines,
startLine,
endLine,
prefix,
- 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 QBLog
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
QBLog: function(){
if (this.loggers) {
for (var i=0; i<this.loggers.length; ++i) {
this.loggers[i](arguments);
}
- 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 init
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function(appIdOrToken, authKeyOrAppId, authSecret, accountKey, configMap) {
console.log('current platform: ', Utils.getEnv());
if (typeof accountKey === 'string' && accountKey.length) {
if (configMap && typeof configMap === 'object') {
config.set(configMap);
Function _onMessage
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
this._onMessage = function (stanza) {
var from = chatUtils.getAttr(stanza, 'from'),
to = chatUtils.getAttr(stanza, 'to'),
type = chatUtils.getAttr(stanza, 'type'),
messageId = chatUtils.getAttr(stanza, 'id'),