Showing 136 of 152 total issues
Avoid deeply nested control flow statements. Open
if (registry.smw_template[templateName + '.wikitext']) {
wikitext += registry.smw_template[templateName + '.wikitext'];
} else {
log('[E] ' + model.$filepath + ' references to non exisiting template: ' + model[mode].template);
}
Function addParameters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
exports.addParameters = function(paramObj, lineBreak) {
'use strict';
var html = '';
for (var paramName in paramObj) {
var paramValue = paramObj[paramName];
- 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
} else if (exports.nodes[modelPageName]) {
edge = _.cloneDeep(edgeTemplate);
// Checks if first char is uppercase. If it is, it references to a Template
Avoid deeply nested control flow statements. Open
for (var paramName in field.sf_form) {
paramObj[paramName] = field.sf_form[paramName];
}
Function callParser
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.callParser = function(settings, generator, data, registry, generated) {
Function exec
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.exec = function(fileMap, importHelper, lib, registry, callback) {
Function exec
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports.exec = function(settings, registry) {
exports.settings = settings;
exports.registry = registry;
- 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 arrayReferencesObjectKey
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports.arrayReferencesObjectKey = function(obj, arrayName, objName) {
if (obj[objName]) {
for (var j = 0; j < obj[arrayName].length; j++) {
var requirement = obj[arrayName][j];
if (!obj.properties[requirement] && requirement !== '*') {
- 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 resolveReference
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports.resolveReference = function(url, hint) {
/** If an error occurs, this gives a hint in which file */
if (hint) {
hint = ' ' + hint + ': ';
- 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 getPagesInNamespace
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports.getPagesInNamespace = function(err, info, next, data) {
if (data && data.query && data.query.allpages) {
// Give feedback how many pages in which namespaces will be deleted
- 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 programmaticImport
has a Cognitive Complexity of 7 (exceeds 5 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'];
- 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 objCollectionToWikitext
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports.objCollectionToWikitext = function(objCollection) {
var wikitext = '';
for (var i = 0; i < objCollection.length; i++) {
- 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 too many return
statements within this function. Open
return finalSettings;
Avoid too many return
statements within this function. Open
return 'Geographic coordinate';
Avoid too many return
statements within this function. Open
return 'Temperature';
Avoid too many return
statements within this function. Open
return 'r="149" g="91" b="244"';
Avoid too many return
statements within this function. Open
return 'r="165" g="165" b="165"';
Avoid too many return
statements within this function. Open
return 'r="244" g="91" b="91"';
Avoid too many return
statements within this function. Open
return 'Date';
Avoid too many return
statements within this function. Open
return 'Quantity';