Showing 324 of 527 total issues
Function exports
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
.then((Activity, Role, Language, Template, Content, Serializer, JSON2YAML) => {
return {
viewingAs: (req, res) => {
res.api({
Function mapSource
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
static mapSource(source) {
SCli.debug('lackey-cms/modules/media/server/models/media', 'mapSource', source);
if (typeof source === 'string') {
return Media.lookupMime(source)
.then((mime) => {
Function setupUI
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Manager.prototype.setupUI = function () {
let self = this,
settingsButton = lackey.hook('header.settings');
Function pageq
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
pageq(options) {
var self = this,
page = this.pageNumber,
cloneData = this.data.rows.slice(),
pages,
Function lookup
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.lookup = (lackeyPath, projectPath) => {
let fn = (_path, options, callback) => {
if (typeof _path === 'string' && _path.indexOf(',') >= 0) {
Function exports
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (dust) => {
dust.helpers.embed = function (chunk, context, bodies, params) {
let
Function rest
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.rest = (req, res, next) => {
req.getRESTQuery = (truncate) => {
let result = {
Function mapDictionary
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
mapDictionary(data) {
data.dictionary = Object
.keys(data.dictionary)
.map(key => {
let value = data.dictionary[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
File gallery.ui.js
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint no-cond-assign:0, no-new:0, no-alert:0 */
/* jslint browser:true, node:true, esnext:true */
'use strict';
/*
Copyright 2016 Enigma Marketing Services Limited
Function embed
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
dust.helpers.embed = function (chunk, context, bodies, params) {
let
route = params.route + '',
template = params.template || false,
Function fn
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
let fn = (_path, options, callback) => {
if (typeof _path === 'string' && _path.indexOf(',') >= 0) {
/* express is stupid */
_path = _path.replace(/\.dust$/, '').split(',');
CRUDInjectionController
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class CRUDInjectionController {
static get field() {
throw new Error('You have to override this method');
}
Function exports
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (dust) => {
dust.helpers.sort = function (chunk, context, bodies, params) {
params.items.sort(function (a, b) {
if (params.by) {
return ((a[params.by] < b[params.by]) ? -1 : ((a[params.by] > b[params.by]) ? 1 : 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 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (dust) => {
function renderParameter(name, chunk, context, bodies, params) {
if (params && params[name]) {
if (typeof params[name] === 'function') {
Function send
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
res.send = (data, forceFormat) => {
res.send = lSend;
let output = {};
output = _.merge(data);
Function exports
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (server) => {
return SUtils
.waitForAs('cms routes',
require('../controllers'),
Function ModalController
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ModalController(rootNode, vars, resolve) {
let dummy,
result = vars.media,
repository;
Function exports
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
.then((ObjectionWrapper) => {
class LanguageModel extends Model {
static get tableName() {
return 'language';
Function exports
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (dust) => {
dust.filters.media = function (value) {
var returnString = '';
if (value.mime === 'video/youtube') {
returnString += '<iframe type="text/html" src="https://www.youtube.com/embed/' + isYoutube(value.source) + '" frameborder="0"></iframe>';
- 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 rest
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
module.exports.rest = (req, res, next) => {
req.getRESTQuery = (truncate) => {
let result = {
- 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"