Showing 33 of 182 total issues
File transforms.test.js
has 553 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
Function deepExtend
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
function deepExtend(objects, collision, path) {
if (objects == null)
return {};
var src, copyIsArray, copy, name, options, clone,
- 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 transformConfig
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
function transformConfig(config, dictionary, platformName) {
var to_ret = _.clone(config);
// The platform can define either a transformGroup or an array
// of transforms. If given a transformGroup that doesn't exist,
- 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
File transforms.js
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
Function transformConfig
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function transformConfig(config, dictionary, platformName) {
var to_ret = _.clone(config);
// The platform can define either a transformGroup or an array
// of transforms. If given a transformGroup that doesn't exist,
File resolveObject.test.js
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
Function buildFile
has 50 lines of code (exceeds 25 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');
Function transformProperty
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function transformProperty(property, options) {
var to_ret = _.clone(property);
var transforms = options.transforms;
for(var i = 0; i < transforms.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
Function traverseObj
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function traverseObj(obj) {
var key;
for (key in obj) {
// We want to check for ignoredKeys, this is to
- 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 deepExtend
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deepExtend(objects, collision, path) {
if (objects == null)
return {};
var src, copyIsArray, copy, name, options, clone,
Function extend
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function extend(opts) {
var options, to_ret;
// Overloaded method, can accept a string as a path that points to a JS or
// JSON file or a plain object. Potentially refactor.
- 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 getStyleDictionaryConfig
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getStyleDictionaryConfig(brand, platform) {
return {
"source": [
`properties/brands/${brand}/*.json`,
"properties/globals/**/*.json",
Function files
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
to_ret.files = (config.files || []).map(function(file) {
const ext = {};
if (file.filter) {
if(typeof file.filter === 'string') {
if (dictionary.filter[file.filter]) {
Function transformObject
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function transformObject(obj, options, path, to_ret) {
to_ret = to_ret || {};
path = path || [];
for(var name in obj) {
- 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 compile_value
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compile_value(value, stack) {
var to_ret, ref;
// Replace the reference inline, but don't replace the whole string because
Function extend
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function extend(opts) {
var options, to_ret;
// Overloaded method, can accept a string as a path that points to a JS or
// JSON file or a plain object. Potentially refactor.
Function registerValidSW
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
Function flattenProperties
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function flattenProperties(properties, to_ret) {
to_ret = to_ret || [];
for(var name in properties) {
if (properties.hasOwnProperty(name)) {
- 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 onCreate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_property_detail);
Function cleanDir
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function cleanDir(destination, format, platform, dictionary, filter) {
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"