benjamine/fiberglass

View on GitHub

Showing 16 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';
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

        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;
        Severity: Minor
        Found in src/gh-pages/publisher.js - About 2 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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        exports.register = function(gulp){
        
          var gutil = require('gulp-util');
        
          gulp.task('watch-browser', ['test-browser'], function() {
        Severity: Major
        Found in src/gulp/tasks/watch-browser.js and 1 other location - About 2 hrs to fix
        src/gulp/tasks/watch.js on lines 3..15

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 83.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        exports.register = function(gulp){
        
          var gutil = require('gulp-util');
        
          gulp.task('watch', ['test'], function() {
        Severity: Major
        Found in src/gulp/tasks/watch.js and 1 other location - About 2 hrs to fix
        src/gulp/tasks/watch-browser.js on lines 3..15

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 83.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

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

          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 */
          Severity: Major
          Found in src/gulp/tasks/bump.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

              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;
              Severity: Minor
              Found in src/gh-pages/publisher.js - About 2 hrs to fix

                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;
                Severity: Minor
                Found in src/gulp/loader.js - About 1 hr 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 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;
                Severity: Minor
                Found in src/gulp/loader.js - About 1 hr to fix

                  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')({
                  Severity: Minor
                  Found in src/gulp/loader.js - About 1 hr to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    GulpTaskLoader.prototype.addBundleTasks = function() {
                      this.bundleTasks.push.apply(this.bundleTasks, arguments);
                      return this;
                    };
                    Severity: Minor
                    Found in src/gulp/loader.js and 1 other location - About 35 mins to fix
                    src/gulp/loader.js on lines 101..104

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 47.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    GulpTaskLoader.prototype.addBundleDependencies = function() {
                      this.bundleDependencies.push.apply(this.bundleDependencies, arguments);
                      return this;
                    };
                    Severity: Minor
                    Found in src/gulp/loader.js and 1 other location - About 35 mins to fix
                    src/gulp/loader.js on lines 96..99

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 47.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language