Showing 726 of 2,177 total issues
Function searchCard
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function searchCard(options) {
if (!options) {
return $q.reject('Missing options');
}
Function DisplayShellProvider
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DisplayShellProvider(ContactDisplayShell) {
var displayShellsRegistered = [];
return {
Function contactActionMoveController
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function contactActionMoveController(
_,
asyncAction,
contactAddressbookDisplayService,
contactAddressbookService,
Function createPlatformAdmin
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createPlatformAdmin(req, res) {
const { type, data } = req.body;
const addPlatformAdminHandlers = {
email: corePlatformAdmin.addPlatformAdminByEmail,
id: corePlatformAdmin.addPlatformAdminById
Function getOne
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getOne(req, res) {
if (!req.params.id) {
return res.status(400).json({ error: { code: 400, message: 'Bad request', details: 'Message ID is required'}});
}
Function _requiresAPILoginAndFailWithError
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _requiresAPILoginAndFailWithError(failWithError = false) {
return (req, res, next) => {
if (req.isAuthenticated()) {
return next();
}
Function removeMembershipRequest
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function removeMembershipRequest(req, res) {
if (!req.isCollaborationManager && !req.user._id.equals(req.params.user_id)) {
return res.status(403).json({error: {code: 403, message: 'Forbidden', details: 'Current user is not the target user'}});
}
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function(application) {
application.all('/api/*', cors({origin: true, credentials: true}));
application.use(require('./middleware/modules'));
Function requireDomainInfo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function requireDomainInfo(req, res, next) {
let details;
if (!req.body.name) {
details = 'Domain does not have name';
Function profile
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function profile(req, res) {
var uuid = req.params.uuid;
const denormalizeOptions = {
includeIsFollowing: true,
includeFollow: true,
Function updateClient
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateClient(callback) {
return getConfig().then(config => {
const hash = getConfigurationHash(config);
if (hash === currentClientHash) {
Function upsertUserAccount
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function upsertUserAccount(user, account, callback) {
var status = 'created';
function accountExists(userAccount) {
return userAccount.type === account.type && userAccount.data && userAccount.data.provider === account.data.provider && userAccount.data.id === account.data.id;
Function createClient
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createClient(options, callback) {
var redisConfig = getRedisConfiguration(options);
var client = redisConfig.client || require('redis').createClient(redisConfig.port || redisConfig.socket, redisConfig.host, redisConfig);
if (redisConfig.pass) {
Function index
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function index(data, options, callback) {
function _index() {
const indexOptions = {
denormalize: options.denormalize || function(data) {return data;},
Function link
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function link(scope, element, attrs) {
scope.updateMembers = updateMembers;
scope.inSlicesOf = attrs.inSlicesOf && angular.isNumber(parseInt(attrs.inSlicesOf, 10)) ?
parseInt(attrs.inSlicesOf, 10) : 3;
scope.error = false;
Function link
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function link(scope) {
scope.additionalData = {
pollChoices: angular.copy(ESN_MESSAGE_DEFAULT_POLL_CHOICES)
};
Function loadNextItems
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
PageAggregatorService.prototype.loadNextItems = function() {
var self = this;
var result = [];
var isFirstPage = self.isFirstPage;
Function searchRouter
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function searchRouter($stateProvider) {
$stateProvider
.state('search', {
url: '/search',
abstract: true,
Function exports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(dependencies) {
var arrayHelper = dependencies('helpers').array;
function getLastResponse(message) {
- 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 canRead
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports.canRead = function(timelineEntry, tuple, callback) {
if (!timelineEntry || !tuple) {
return callback(new Error('timelineEntry and tuple are required'));
}
- 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"