Showing 12 of 16 total issues
Function bundle
has 94 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
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
function bundleTask(callback) {
var browserifyOptions = options.browserifyOptions || {};
browserifyOptions.debug = true;
Function publish
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function publish(projectRoot){
var packageInfo = require(path.join(projectRoot, 'package.json'));
cd(projectRoot);
var branchIsNew = false;
- 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 bundler.js
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
var path = require('path');
var fs = require('fs');
var _ = require('underscore.string');
var browserify = require('browserify');
Function register
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.register = function(gulp, loader){
var projectRoot = loader.projectRoot;
require('shelljs/global');
/*global config, exec, cd */
Function bundlify
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bundlify(min) {
if (watchBundles) {
browserifyOptions.cache = {};
browserifyOptions.packageCache = {};
browserifyOptions.fullPaths = true;
Function publish
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publish(projectRoot){
var packageInfo = require(path.join(projectRoot, 'package.json'));
cd(projectRoot);
var branchIsNew = false;
Function get
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
GulpTaskLoader.prototype.get = function() {
var args = Array.prototype.slice.apply(arguments).filter(function(arg){
return typeof arg === 'string' && arg.length > 0;
});
var self = this;
- 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 get
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
GulpTaskLoader.prototype.get = function() {
var args = Array.prototype.slice.apply(arguments).filter(function(arg){
return typeof arg === 'string' && arg.length > 0;
});
var self = this;
Function GulpTaskLoader
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GulpTaskLoader(gulp, projectRoot){
this.projectRoot = projectRoot;
this.gulp = gulp;
this.options = {};
this.plugins = require('gulp-load-plugins')({