Showing 8 of 10 total issues
Function build
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
AssetManifestGenerator.prototype.build = function() {
var supportedTypes = this.supportedTypes;
var generateURI = this.generateURI;
var prepend = this.prepend;
var filesToIgnore = this.filesToIgnore;
- 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 build
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
AssetManifestGenerator.prototype.build = function() {
var supportedTypes = this.supportedTypes;
var generateURI = this.generateURI;
var prepend = this.prepend;
var filesToIgnore = this.filesToIgnore;
Function css
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default nodeLoader(function css(uri) {
return new RSVP.Promise((resolve, reject) => {
if (document.querySelector(`link[href="${uri}"]`)) {
return 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
Function generateAssetManifest
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function generateAssetManifest(tree, options) {
options = options || {};
var bundlesLocation = options.bundlesLocation || 'bundles';
var filesToIgnore = options.filesToIgnore || [];
Function manifest
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var manifest = walk(inputPath).reduce(function(manifest, entry) {
var pathParts = entry.split('/');
var assetName = pathParts.pop();
var bundleName = pathParts.shift();
Function css
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default nodeLoader(function css(uri) {
return new RSVP.Promise((resolve, reject) => {
if (document.querySelector(`link[href="${uri}"]`)) {
return resolve();
}
Function loadBundle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loadBundle(name, retryLoad) {
const cachedPromise = this._getFromCache('bundle', name, retryLoad === RETRY_LOAD_SECRET);
if (cachedPromise) {
return cachedPromise;
- 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 compareAndIterate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function compareAndIterate(initial, current, diffHandler) {
if (initial.length < current.length) {
for (let i = 0; i < current.length; i++) {
let entry = current[i];
if (!has(initial, entry)) {
- 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"