Showing 50 of 196 total issues
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
Function build
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function build (pagepath, partial_pages, fullpath) {
// decides if pagepath is folder or file
if (pagepath.length == 1) {
Function culturize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function culturize (context, culture) {
if (typeof (context) != 'object') {
return context
}
- 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 request_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
remote_handler.prototype.request_file = function (url) {
return new Promise(function (resolve, reject) {
if (flat_helpers.is_local(url)) {
fs.readFile(url, 'utf8', function (err, data) {
if (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 call
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
api_call.prototype.call = function (req, res, enduro_server) {
// gets query parameters
const sid = req.query.sid
const globalizer_string = req.query.globalizer_string
Function abstract_diff_item
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function abstract_diff_item (item) {
item.filename = item.name1 || item.name2
item.name = item.filename
item.type = item.type1 || item.type2
Function call
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
api_call.prototype.call = function (req, res, enduro_server) {
const sid = req.query.sid
enduro.flags.temporary_nostaticwatch = true
Function get_user_by_username
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
admin_security.prototype.get_user_by_username = function (username) {
return new Promise(function (resolve, reject) {
// load up all admins
return flat.load(enduro.config.admin_secure_file)
.then((raw_userlist) => {
- 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 upload_by_url
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
file_uploader.prototype.upload_by_url = function (file_url) {
const self = this
return new Promise(function (resolve, reject) {
const filename = flat_helpers.get_filename_from_url(file_url)
Function upload
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
filesystem.prototype.upload = function (filename, path_to_file) {
const self = this
return new Promise(function (resolve, reject) {
Function render_file_by_context
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
page_renderer.prototype.render_file_by_context = function (template_path, context, culture) {
// extracts the relative path to the template from the absolute path
const file_regex_match = template_path.match(/pages(?:\/|\\)(.*)\.([^\\/]+)$/)
const filename = file_regex_match[1]
Function call
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
api_call.prototype.call = function (req, res, enduro_server) {
// gets query parameters
const sid = req.query.sid
const filename = req.query.filename
Function diff
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
juice_diff.prototype.diff = function (path1, path2) {
let store_compare_result
return dircompare.compare(path1, path2)
.then((compare_result) => {
Function get_global_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
global_data.prototype.get_global_data = function () {
// Constants
const data_path = [enduro.project_path + '/cms/global/**/*.js', enduro.project_path + '/cms/.settings.js']
Function verify_passphrase
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
trollhunter.prototype.verify_passphrase = function (passphrase) {
return new Promise(function (resolve, reject) {
if (!passphrase) {
return reject('no passphrase provided')
- 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 traverse_offline
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function traverse_offline (context, list_of_external_resources_to_download) {
for (c in context) {
if (typeof context[c] === 'string') {
links = parse_for_external_links(context[c])
- 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 register
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
helper.prototype.register = function () {
enduro.templating_engine.registerHelper('grouped_each', function (every, context, options) {
if (!context || !(Object.keys(context).length || context.length)) {
- 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 get_ab_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
ab_tester.prototype.get_ab_list = function () {
return page_queue_generator.get_all_pages()
.then((pages) => {
// gets page list
- 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 register
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
helper.prototype.register = function () {
enduro.templating_engine.registerHelper('times', function (iterations, upperrange, block) {
// will store the final accumulated html
- 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 read_helpers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
helper_handler.prototype.read_helpers = function () {
return new Promise(function (resolve, reject) {
glob([flat_helpers_PATH, PROJECT_HELPERS_PATH], function (err, files) {
if (err) { return console.log(err) }
async.each(files, function (file, callback) {
- 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"