Showing 136 of 152 total issues
Function registryStatistics
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.registryStatistics = function(settings, registry) {
'use strict';
exports.settings = settings;
Function analyzeFields
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
exports.analyzeFields = function(fields) {
'use strict';
for (var fieldName in fields) {
- 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 writeSchemas
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.writeSchemas = function() {
'use strict';
// Requirements are function specific, because this function is very rarely called at all
var fs = require('fs-extra');
Function walk
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.walk = function(dir, callback) {
'use strict';
var results = [];
Function exec
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
exports.exec = function(settings, jobs) {
'use strict';
var i = 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 generateCategory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
exports.generateCategory = function(settings, obj, name, registry) {
// If smw_category is set to false, don't create a category
if (obj.smw_category === false) {
return false;
- 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 orderObjectProperties
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
exports.orderObjectProperties = function(obj) {
'use strict';
if (obj.properties) {
- 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 interpretFile
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
exports.interpretFile = function(file, fileName, relativeFilePath, fileExtension) {
var obj;
var isObject = true;
- 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 prePostFix
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.prePostFix = function(mode, model, registry) {
var wikitext = '';
if (model.items) {
Function mergeObjects
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.mergeObjects = function(obj1, obj2) {
return _.merge(obj1, obj2, function(objectValue, sourceValue, key) {
if (_.isArray(objectValue)) {
Function interpretFile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.interpretFile = function(file, fileName, relativeFilePath, fileExtension) {
var obj;
var isObject = true;
Function analyzeFields
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.analyzeFields = function(fields) {
'use strict';
for (var fieldName in fields) {
Function programmaticImport
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.programmaticImport = function(fileMap, dirName, callback) {
// Delete the import.js from the map, since it will be loaded dynamically
delete fileMap['import.js'];
Function writeStatistics
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.writeStatistics = function(statistics, directory) {
// To Logobject / report
log(statistics, true);
Function inherit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.inherit = function(obj, registry) {
'use strict';
if (obj.$path) {
exports.inheritanceStack.push(obj.$path);
Function convertPropertyArray
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.convertPropertyArray = function(items, objId) {
'use strict';
var propertyObject = {};
Function getColor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.getColor = function(type) {
'use strict';
if (type) {
if (type === 'Form') {
return 'r="73" g="199" b="232"';
- 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 upgradePropertyNotation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.upgradePropertyNotation = function(obj) {
// This only applies to models and forms.
// fields already use the item notation. Don't change anything there!
if (obj.$modelPart === 'model' || obj.$modelPart === 'form') {
- 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 upgradePrePostfixes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.upgradePrePostfixes = function(obj, prePostFix) {
// Prefix
if (obj[prePostFix]) {
- 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 callParser
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.callParser = function(settings, generator, data, registry, generated) {
'use strict';
for (var name in data) {