Showing 152 of 152 total issues
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) {
Function onEdit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var onEdit = function(err, response) {
uploadStatus++;
if (err) {
Function exec
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.exec = function(importModelDir) {
'use strict';
return new Promise(function(resolve, reject) {
Function validateRegistry
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.validateRegistry = function(registry) {
'use strict';
return new Promise(function(resolve) {
- 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
Avoid deeply nested control flow statements. Open
for (fieldName in model.properties) {
field = model.properties[fieldName];
if (field.smw_drilldown) {
drilldowninfo.push({
name: field.title,
Avoid deeply nested control flow statements. Open
if (err.message.indexOf('has been created already') > -1) {
log('[D] Skipping existing page.');
} else {
log('[E] mobo could not upload a page.');
console.dir(err);
Function calculateLogStatistics
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
exports.calculateLogStatistics = function() {
var logHistory = semlog.getLogHistory();
var logStats = {
total: logHistory.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
Avoid deeply nested control flow statements. Open
if (model.items) {
modelId = model.items.id;
}
Avoid deeply nested control flow statements. Open
for (var i = 0; i < inspect.form.length; i++) {
edge = _.cloneDeep(edgeTemplate);
var target = inspect.form[i];
Avoid deeply nested control flow statements. Open
} else if (template.wikitext) {
// Ignore "wikitext" properties, since they'll only be rendered on the form edit page
if (exports.settings.debug) {
log('[D] Ignoring form-only "wikitext" injection');
Function writeStatistics
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
exports.writeStatistics = function(statistics, directory) {
// To Logobject / report
log(statistics, 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 exec
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
exports.exec = function(settings, obj, name, registry) {
'use strict';
// Do not create abstract or ignored forms
if (obj.$abstract || obj.$ignore) {
- 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
Avoid deeply nested control flow statements. Open
if (modelId) {
var edgeId = formPageName + '-' + modelName;
// Ignore wikitext attributes, since they are directly written into the form template
if (!exports.edges[edgeId] && !model.wikitext) {