benjamine/fiberglass

View on GitHub
src/gulp/tasks/util/bundler.js

Summary

Maintainability
D
2 days
Test Coverage

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';
Severity: Major
Found in src/gulp/tasks/util/bundler.js - About 3 hrs to fix

    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';
    Severity: Minor
    Found in src/gulp/tasks/util/bundler.js - About 3 hrs to fix

    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;
    Severity: Major
    Found in src/gulp/tasks/util/bundler.js - About 3 hrs to fix

      Function bundleTask has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function bundleTask(callback) {
      
          var browserifyOptions = options.browserifyOptions || {};
          browserifyOptions.debug = true;
      
      
      Severity: Major
      Found in src/gulp/tasks/util/bundler.js - About 3 hrs to fix

        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');
        Severity: Minor
        Found in src/gulp/tasks/util/bundler.js - About 2 hrs to fix

          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;
          Severity: Major
          Found in src/gulp/tasks/util/bundler.js - About 2 hrs to fix

            There are no issues that match your filters.

            Category
            Status