Showing 33 of 182 total issues
Function combineJSON
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function combineJSON(arr, deep, collision) {
var i, files = [],
to_ret = {};
for (i = 0; i < arr.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 deeply nested control flow statements. Open
if ( copyIsArray ) {
copyIsArray = false;
clone = src && _.isArray(src) ? src : [];
} else {
clone = src && _.isPlainObject(src) ? src : {};
Avoid deeply nested control flow statements. Open
} else if ( copy !== undefined ) {
if (src != null && typeof collision == 'function') {
collision({target: target, copy: options, path: path, key: name});
}
target[ name ] = copy;
Function minifyDictionary
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function minifyDictionary(obj) {
var toRet = {};
if (obj.hasOwnProperty('value')) {
return obj.value;
} else {
- 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 cleanDir
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function cleanDir(destination, format, platform, dictionary, filter) {
Function buildFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function buildFile(destination, format, platform, dictionary, filter) {
Function cleanFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function cleanFile(destination, format, platform, dictionary, filter) {
Method getAllBaseColors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected ArrayList<BaseColorListItem> getAllBaseColors() {
ArrayList<StyleDictionaryNode> baseColors = getBaseColorList();
ArrayList<BaseColorListItem> allColors = new ArrayList<>();
ArrayList<String> path = new ArrayList<>();
path.add("color");
- 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 buildFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function buildFile(destination, format, platform, dictionary, filter) {
if (typeof format !== 'function')
throw new Error('Please enter a valid file format');
if (typeof destination !== 'string')
throw new Error('Please enter a valid destination');
- 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 selfRef
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function selfRef(str, obj) {
var i,
ref=obj,
array = str.split(options.separator),
context = current_context.join(options.separator);
- 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 registerTransform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function registerTransform(options) {
if (typeof options.type !== 'string')
throw new Error('type must be a string');
if (transformTypes.indexOf(options.type) < 0)
throw new Error(options.type + ' type is not one of: ' + transformTypes.join(', '));
- 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
Method getNodeArrayForObject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static ArrayList<StyleDictionaryNode> getNodeArrayForObject(JSONObject json) {
final ArrayList<StyleDictionaryNode> nodeList = new ArrayList<>();
Iterator<String> keys = json.keys();
while(keys.hasNext()) {
String key = keys.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 propertySetup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function propertySetup(property, name, path) {
if (!property && !_.isPlainObject(property))
throw new Error('Property object must be an object');
if (!name || !_.isString(name))
throw new Error('Name must be a string');
- 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"