mcfly-io/generator-sublime

View on GitHub

Showing 14 of 41 total issues

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 exports has 100 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function() {
            var readTextFile = function(filename) {
                var body = fs.readFileSync(filename, 'utf8');
                return body;
            };
        Severity: Major
        Found in test/testHelper.js - About 4 hrs to fix

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

                  askFor: function() {
          
                      var done = this.async();
          
                      var choices = this.allFiles.map(function(file) {
          Severity: Major
          Found in app/index.js - About 2 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

              File gulps.tests.js has 262 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              var path = require('path');
              var helpers = require('yeoman-generator').test;
              var testHelper = require('./testHelper')();
              Severity: Minor
              Found in test/gulps.tests.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 askForGithub has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        askForGithub: function() {
                            var done = this.async();
                            var that = this;
                            var prompts = [{
                                name: 'githubUser',
                Severity: Minor
                Found in app/index.js - About 1 hr to fix

                  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

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

                            var projectFiles = function(done, expectedTasks, assertNoFile) {
                                assertNoFile = assertNoFile !== false;
                                // always tranform the argument into an array
                                expectedTasks = expectedTasks ? [].concat(expectedTasks) : [];
                    
                    
                    Severity: Minor
                    Found in test/gulps.tests.js - About 1 hr to fix

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

                              projectFiles: function() {
                      
                                  this.sourceRoot(path.join(__dirname, '../templates/app'));
                      
                                  // if (this.Jshintrc) {
                      Severity: Minor
                      Found in app/index.js - About 25 mins 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 askFor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                              askFor: function() {
                      
                                  var done = this.async();
                      
                                  var choices = this.allFiles.map(function(file) {
                      Severity: Minor
                      Found in app/index.js - About 25 mins 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 exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function() {
                          var readTextFile = function(filename) {
                              var body = fs.readFileSync(filename, 'utf8');
                              return body;
                          };
                      Severity: Minor
                      Found in test/testHelper.js - About 25 mins 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

                      Severity
                      Category
                      Status
                      Source
                      Language