Showing 101 of 230 total issues
Function exports
has 250 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function() {
let teamRolesMap = {
member: { priority: 1 },
editor: { priority: 5 },
Function exports
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function() {
function populateOwnerInfo(search) {
if (null == search.owner) {
return q(search);
Function exports
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function() {
let teamRolesMap = {
member: { priority: 1 },
editor: { priority: 5 },
- 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 28 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function() {
function populateOwnerInfo(search) {
if (null == search.owner) {
return q(search);
- 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 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function() {
/**
* Copies the mutable fields from src to dest
*
Function getConsumer
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
KafkaConsumer.prototype.getConsumer = function() {
let self = this;
// Initialize the deferred promise, if we don't already have one.
self.deferred = self.deferred || q.defer();
Function adminGetCSV
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.adminGetCSV = (req, res) => {
let exportId = req.params.exportId;
exportConfigService.getConfigById(exportId)
.then((result) => {
Function exports
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function() {
passport.use(new ProxyPkiStrategy({
header: 'x-ssl-client-s-dn'
}, function(req, dn, done) {
Function reset
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.reset = (req, res, next) => {
// Init Variables
let password = req.body.password;
Function forgot
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.forgot = (req, res, next) => {
// Make sure there is a username
if(null == req.body.username) {
return res.status(400).json({ message: 'Username is missing.' });
File teams.server.service.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
let
path = require('path'),
q = require('q'),
File admin-list-users.component.ts
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, ViewChild } from '@angular/core';
import { Response } from '@angular/http';
import { ActivatedRoute, Params } from '@angular/router';
import * as _ from 'lodash';
Function checkAdminAccess
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected checkAdminAccess(url: string, route: ActivatedRouteSnapshot): boolean {
if (!this.userStateService.user.isAdmin()) {
// -----------------------------------------------------------
// Check the role requirements for the route
// -----------------------------------------------------------
- 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 searchTeams
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function searchTeams(search, query, queryParams, user) {
let page = util.getPage(queryParams);
let limit = util.getLimit(queryParams, 1000);
let offset = page * limit;
Function searchTags
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function searchTags(search, query, queryParams, user) {
let page = util.getPage(queryParams);
let limit = util.getLimit(queryParams);
let offset = page * limit;
Function toMongoose
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function toMongoose(obj) {
if (null != obj) {
if (typeof obj === 'object') {
if (Array.isArray(obj)) {
var arr = [];
- 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 handleErrorResponse
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected handleErrorResponse(err: any, _caught: Observable<any>): Observable<any> {
let errData = _.isString(err._body) ? JSON.parse(err._body) : err._body;
switch (err.status) {
case 401:
- 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 searchResources
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function searchResources(query, queryParams, user) {
let page = util.getPage(queryParams);
let limit = util.getLimit(queryParams, 1000);
Function updateCurrentUser
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.updateCurrentUser = (req, res) => {
// Make sure the user is logged in
if (null == req.user){
res.status(400).json({
Function getErrorMessage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports.getErrorMessage = function(err) {
var message = '';
if (null == err || typeof err === 'string') {
message = err;
- 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"