Showing 50 of 196 total issues
Function generate_cms_list
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
pagelist_generator.prototype.generate_cms_list = function () {
return new Promise(function (resolve, reject) {
glob(enduro.project_path + '/cms/**/*.js', function (err, files) {
if (err) { console.log('failed to generate cms list', 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"
Further reading
Function create_from_theme
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
theme_manager.prototype.create_from_theme = function (theme_name) {
const self = this
logger.init('Enduro theme service')
Function browsersync_start
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function browsersync_start (norefresh) {
logger.timestamp('browsersync started', 'enduro_events')
browser_sync.init({
server: {
baseDir: enduro.project_path + '/' + enduro.config.build_folder,
Function run
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
enduro_server.prototype.run = function (server_setup) {
// stores current enduro_server instance
const self = this
server_setup = server_setup || {}
Function action
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
action.prototype.action = function (dont_do_juice_pull) {
logger.init('Enduro', 'enduro_render_events')
return Promise.resolve()
.then(() => {
File juicebox.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
// * ———————————————————————————————————————————————————————— * //
// * juicebox
// * deals with lack of persistent storage plus adds backup and versioning
// * ———————————————————————————————————————————————————————— * //
const juicebox = function () {}
Function generate_cms_list
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
pagelist_generator.prototype.generate_cms_list = function () {
return new Promise(function (resolve, reject) {
glob(enduro.project_path + '/cms/**/*.js', function (err, files) {
if (err) { console.log('failed to generate cms list', err) }
Function handler
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
handler: function (cli_arguments) {
logger.init('setting up s3')
return inquirer.prompt([
{
Function browsersync_start
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function browsersync_start (norefresh) {
logger.timestamp('browsersync started', 'enduro_events')
browser_sync.init({
server: {
baseDir: enduro.project_path + '/' + enduro.config.build_folder,
- 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 pull
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
juicebox.prototype.pull = function (force) {
const self = this
// if juicebox is not enabled or disabled by flags
if (!enduro.config.juicebox_enabled) {
Function read_config
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
enduro_linker.prototype.read_config = function () {
return require(enduro.enduro_path + '/libs/configuration/enduro_configurator').read_config()
.then(() => {
// stores filesystem
- 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 handler
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
handler: function (cli_arguments) {
logger.init('setting up juicebox')
let turning_on = true
Function init
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
js_handler.prototype.init = function (gulp, browser_sync) {
// stores task name
const js_handler_task_name = 'js';
gulp.task(js_handler_task_name, function() {
Function route_context
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
globalizer_handler.prototype.route_context = function (context, globalizer_string) {
return globalizer_string
.substring(2)
.split('.')
.reduce((prev, next) => {
- 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 generate_pagelist
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
page_queue_generator.prototype.generate_pagelist = function () {
const self = this
return new Promise(function (resolve, reject) {
Function load
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
flat.prototype.load = function (filename, is_full_absolute_path) {
const self = this
return new Promise(function (resolve, reject) {
Function force_pack
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
juicebox.prototype.force_pack = function (user) {
return new Promise(function (resolve, reject) {
// sets user to developer if juicing is caused by console
user = user || 'developer'
Function add_admin
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
admin_security.prototype.add_admin = function (username, password, tags) {
const self = this
return new Promise(function (resolve, reject) {
Function fetch_theme_info_by_name
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
theme_manager.prototype.fetch_theme_info_by_name = function (theme_name, options) {
const self = this
// list all themes and exit if specified theme is not found
if (!theme_name) {
Function call
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
api_call.prototype.call = function (req, res, enduro_server) {
let jsonString = ''
req.on('data', function (data) {
jsonString += data