Showing 34 of 4,910 total issues
Function keys
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Object.keys = (function () {
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
dontEnums = [
Function DBRepository
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DBRepository = (Entity, options = {}) => {
const DB = Entity.dao;
return {
Function Persistence
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Persistence = (Entity, FactoryDBRepository = DFactoryDBRepository) => {
const DBRepository = FactoryDBRepository(Entity);
return {
Function ApplicationAnalytics
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ApplicationAnalytics = (Entity, PersistenceServices = DPersistenceServices) => {
return {
create(req, res, next) {
Function replacePath
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function replacePath (path, keys) {
var index = 0;
function replace (_, escaped, prefix, key, capture, group, suffix, escape) {
if (escaped) {
Function initDynamic
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initDynamic() {
// Bootstrap popover
$('button[data-toggle="popover"]').popover().click(function(e) {
e.preventDefault();
});
Function pathToRegexp
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pathToRegexp (path, keys, options) {
keys = keys || [];
if (!isArray(keys)) {
options = keys;
Function replace
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function replace (_, escaped, prefix, key, capture, group, suffix, escape) {
Function AppTooltip
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function AppTooltip(app, clk=true) {
var tooltip = $('#app-tooltip');
var lock = null;
var connectors = $('.svg-pan-zoom_viewport .conector_h');
- 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 where
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Query.prototype.where = function (key, value) {
// if object was passed instead of key-value pair
// iterate over that object and call .where(key, value)
if (_.isObject(key)) {
let conditions = key;
- 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 validateFile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const validateFile = (file, opts) => {
const defaultParams = {
maxsize: 1630240, //~1 mb,
minsize: 1024, // 1 kbs
- 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 find
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Query.prototype.find = function (query, options) {
let Model = this.model;
query = _.assign({}, this.query, query);
- 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 AppSVG
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function AppSVG(svg) {
this.app = null;
this.root = null;
this.setupSVGObject = function() {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function () {
const passport = new Passport();
const strategy = new Strategy(config.jwtSecret, function (payload, done) {
- 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"