Showing 726 of 2,177 total issues
Function exports
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(dependencies) {
var logger = dependencies('logger');
var collaborationModule = dependencies('collaboration');
var messageModule = dependencies('message');
File avatar.js
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
angular.module('esn.avatar', [
'esn.constants',
'mgcrea.ngStrap',
Function profilePopoverCardService
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
function profilePopoverCardService(
$rootScope,
$compile,
$modal,
$log,
File contact-show.controller.spec.js
has 470 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* global sinon, chai: false */
var expect = chai.expect;
Function exports
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function() {
function getFormattedName(json) {
if (json.title[0]) {
return json.title[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 exports
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(dependencies) {
var logger = dependencies('logger');
var pubsub = dependencies('pubsub');
var registry = require('./registry')(dependencies);
- 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 getTracker
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.getTracker = function(type) {
var Tracker = getModel(type);
if (!Tracker) {
throw new Error(type + ' is not a valid tracker type');
File box-overlay.spec.js
has 460 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* global chai: false, sinon: false */
var expect = chai.expect;
File websocket.js
has 457 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
angular.module('esn.websocket', ['esn.authentication', 'esn.session', 'esn.socketio', 'esn.http'])
.factory('IoAction', function($timeout) {
function getNgCallback(callback) {
File index.js
has 443 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const _ = require('lodash');
const async = require('async');
const localpubsub = require('../../pubsub').local;
File controller.js
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const q = require('q');
const PATH = 'addressbooks';
Function boxOverlayProvider
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
function boxOverlayProvider() {
this.$get = function($window, $rootScope, $timeout, $q, boxOverlayManager, BoxOverlayStateManager, deviceDetector, DEVICES, ESN_BOX_OVERLAY_EVENTS) {
return BoxOverlayFactory;
function BoxOverlayFactory(config) {
Function exports
has 158 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = dependencies => {
const logger = dependencies('logger');
const elasticsearch = dependencies('elasticsearch');
const pubsub = dependencies('pubsub');
const listener = require('./listener')(dependencies);
Function $get
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.$get = function($window, $rootScope, $timeout, $q, boxOverlayManager, BoxOverlayStateManager, deviceDetector, DEVICES, ESN_BOX_OVERLAY_EVENTS) {
return BoxOverlayFactory;
function BoxOverlayFactory(config) {
var scope = angular.extend($rootScope.$new(), config);
Function exports
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(dependencies) {
var lib = {};
var emailTokenModel = require('../backend/db/models/email-recipient-token');
Function ContactsHelper
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ContactsHelper(
$filter,
esnDatetimeService,
contactAddressbookDisplayService,
CONTACT_ATTRIBUTES_ORDER
File contact-live-update.service.spec.js
has 411 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* global chai: false */
/* global sinon: false */
Function exports
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(dependencies) {
var logger = dependencies('logger');
var pubsub = dependencies('pubsub');
var registry = require('./registry')(dependencies);
Function esnDatetimeService
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
function esnDatetimeService(
$q,
_,
moment,
esnConfig,
Function init
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function init(dependencies) {
const logger = dependencies('logger');
const pubsub = dependencies('pubsub').global;
const io = dependencies('wsserver').io;
- 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"