JLBoor/generator-jlb-angular

View on GitHub

Showing 16 of 42 total issues

Function exports has 227 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (grunt) {

    // load all grunt tasks
    require('load-grunt-tasks')(grunt);

Severity: Major
Found in app/templates/skeleton/Gruntfile.js - About 1 day to fix

    Function askForDir has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.askForDir = function(type,that,module,ownDir,cb){
    
        that.module = module;
        that.appname = module.name;
        that.dir = path.dirname(module.file);
    Severity: Major
    Found in utils.js - About 2 hrs to fix

      File Gruntfile.js has 252 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*jslint node: true */
      'use strict';
      
      var pkg = require('./package.json');
      var _ = require('./package.json');
      Severity: Minor
      Found in app/templates/skeleton/Gruntfile.js - About 2 hrs to fix

        Function askForDir has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        exports.askForDir = function(type,that,module,ownDir,cb){
        
            that.module = module;
            that.appname = module.name;
            that.dir = path.dirname(module.file);
        Severity: Minor
        Found in utils.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 askFor has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        ServiceGenerator.prototype.askFor = function askFor() {
            var cb = this.async();
            var that = this;
        
            var prompts = [{
        Severity: Minor
        Found in service/index.js - About 1 hr to fix

          Function exports has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (config) {
              config.set({
          
                  // base path that will be used to resolve all patterns (eg. files, exclude)
                  basePath: '',
          Severity: Minor
          Found in app/templates/skeleton/karma.conf.js - About 1 hr to fix

            Function dirPromptCallback has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var dirPromptCallback = function (props) {
            
                    that.dir = path.join(props.dir,'/');
                    var dirToCreate = that.dir;
                    if (ownDir){
            Severity: Minor
            Found in utils.js - About 1 hr to fix

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

              ModuleGenerator.prototype.askFor = function askFor() {
                  var cb = this.async();
                  var that = this;
                  var modulePath = that.name ? that.name.split('.') : [];
              
              
              Severity: Minor
              Found in module/index.js - About 1 hr to fix

                Function decode has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            decode: function (input) {
                                var output = "";
                                var chr1, chr2, chr3 = "";
                                var enc1, enc2, enc3, enc4 = "";
                                var i = 0;

                  Function getParentModule has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  exports.getParentModule = function(dir){
                      //starting this dir, find the first module and return parsed results
                      if (fs.existsSync(dir)) {
                          var files = fs.readdirSync(dir);
                          for (var i = 0; i < files.length; i++) {
                  Severity: Minor
                  Found in utils.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 encode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              encode: function (input) {
                                  var output = "";
                                  var chr1, chr2, chr3 = "";
                                  var enc1, enc2, enc3, enc4 = "";
                                  var i = 0;

                    Function processTemplates has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    exports.processTemplates = function(name,dir,type,that,defaultDir,configName,module){
                    Severity: Major
                    Found in utils.js - About 50 mins to fix

                      Function injectRoute has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      exports.injectRoute = function(moduleFile,uirouter,name,route,routeUrl,that){
                      Severity: Minor
                      Found in utils.js - About 45 mins to fix

                        Function askForDir has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        exports.askForDir = function(type,that,module,ownDir,cb){
                        Severity: Minor
                        Found in utils.js - About 35 mins to fix

                          Function askFor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          ModuleGenerator.prototype.askFor = function askFor() {
                              var cb = this.async();
                              var that = this;
                              var modulePath = that.name ? that.name.split('.') : [];
                          
                          
                          Severity: Minor
                          Found in module/index.js - About 35 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 inject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          exports.inject = function(filename,that,module) {
                              //special case to skip unit tests
                              if (_(filename).endsWith('.spec.js')) { return; }
                          
                              if (_(filename).startsWith(APP_FOLDER)) {
                          Severity: Minor
                          Found in utils.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