mcfly-io/generator-sublime

View on GitHub
gulps/index.js

Summary

Maintainability
F
3 days
Test Coverage

File index.js has 539 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';
var path = require('path');
var generators = require('yeoman-generator');
var _ = require('lodash');
var chalk = require('chalk');
Severity: Major
Found in gulps/index.js - About 1 day to fix

    Function projectFiles has 217 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            projectFiles: function() {
                this.npmPackages = null;
                var done = this.async();
                if (this.Tasks.length <= 0) {
                    this.log(chalk.bold.yellow('You didn\'t select any gulp task'));
    Severity: Major
    Found in gulps/index.js - About 1 day to fix

      Function constructor has 162 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          constructor: function() {
      
              generators.Base.apply(this, arguments);
              this.allTasks = [
                  'lint',
      Severity: Major
      Found in gulps/index.js - About 6 hrs to fix

        Function askFor has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                askFor: function() {
        
                    var done = this.async();
                    var that = this;
                    var choices = this.allTasks.map(function(task) {
        Severity: Major
        Found in gulps/index.js - About 2 hrs to fix

          Function projectFiles has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

                  projectFiles: function() {
                      this.npmPackages = null;
                      var done = this.async();
                      if (this.Tasks.length <= 0) {
                          this.log(chalk.bold.yellow('You didn\'t select any gulp task'));
          Severity: Minor
          Found in gulps/index.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 install has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              install: function() {
          
                  if (!this.npmPackages) {
                      return;
                  }
          Severity: Minor
          Found in gulps/index.js - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status