src/gulp/tasks/util/bundler.js
Function bundle
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bundle(gulp, plugins, options) {
var packageInfo = options.packageInfo;
var name = options.name || packageInfo.name;
var taskName = 'bundle-' + name;
var src = options.src || './src/main.js';
Function bundle
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
function bundle(gulp, plugins, options) {
var packageInfo = options.packageInfo;
var name = options.name || packageInfo.name;
var taskName = 'bundle-' + name;
var src = options.src || './src/main.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 auto
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function auto(loader) {
var gulp = loader.gulp;
var plugins = loader.plugins;
var packageInfo = loader.packageInfo();
var loaderOptions = loader.options;
Function bundleTask
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bundleTask(callback) {
var browserifyOptions = options.browserifyOptions || {};
browserifyOptions.debug = true;
File bundler.js
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var path = require('path');
var fs = require('fs');
var _ = require('underscore.string');
var browserify = require('browserify');
Function bundlify
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bundlify(min) {
if (watchBundles) {
browserifyOptions.cache = {};
browserifyOptions.packageCache = {};
browserifyOptions.fullPaths = true;