42Zavattas/generator-bangular

View on GitHub

Showing 12 of 32 total issues

Function prompting has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  prompting: function () {

    if (this.skipConfig) { return ; }

    var done = this.async();
Severity: Major
Found in app/index.js - About 5 hrs to fix

    Function prompting has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      prompting: function () {
    
        if (this.skipConfig) { return ; }
    
        var done = this.async();
    Severity: Major
    Found in anim/index.js - About 2 hrs to fix

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

        prompting: function () {
          var done = this.async();
      
          this.instanceName = _.camelize(this.name);
          this.instancesName = _.camelize(this.name) + 's';
      Severity: Minor
      Found in api/index.js - About 1 hr to fix

        Function writing has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          writing: function () {
        
            mkdir.sync('client/assets/fonts/' + this.name);
        
            if (!utils.fileExists('client/styles/fonts.scss')) {
        Severity: Minor
        Found in font/index.js - About 1 hr to fix

          Function prompting has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            prompting: function () {
          
              var done = this.async();
          
              this.types = {};
          Severity: Minor
          Found in font/index.js - About 1 hr to fix

            Function writing has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              writing: function () {
            
                var filters = this.config.get('filters');
                var filesByBackendType = {
                  mongo: ['controller.js', 'model.js'],
            Severity: Minor
            Found in api/index.js - About 1 hr to fix

              Function rewrite has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                rewrite: function (args) {
                  // check if splicable is already in the body text
                  var re = new RegExp(args.splicable.map(function (line) {
                    return '\s*' + escapeRegExp(line);
                  }).join('\n'));
              Severity: Minor
              Found in util.js - About 1 hr to fix

                Function writing has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  writing: function () {
                
                    var basePath = 'client/views/' + this.dashName + '/' + this.dashName;
                
                    this.template('index.js', basePath + '.js');
                Severity: Minor
                Found in route/index.js - About 1 hr to fix

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

                    processDirectory: function (self, source, destination) {
                      var root = isPathAbsolute(source) ? source : path.join(self.sourceRoot(), source);
                      var files = glob.sync('**', { dot: true, nodir: true, cwd: root });
                      var dest, src;
                  
                  
                  Severity: Minor
                  Found in util.js - About 1 hr to fix

                    Function appendOnTop has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      appendOnTop: function (opts, cb) {
                        fs.readFile(opts.dest, function (err, data) {
                          if (err) { return cb(err, null); }
                          fs.writeFile(opts.dest, opts.append + '\n', function (err) {
                            if (err) { return cb(err, null); }
                    Severity: Minor
                    Found in util.js - About 55 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 writing has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      writing: function () {
                    
                        var basePath = 'client/directives/' + this.dashName + '/' + this.dashName;
                    
                        this.template('directive.js', basePath + '.directive.js');
                    Severity: Minor
                    Found in directive/index.js - About 45 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 isAuthenticated has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    exports.isAuthenticated = function () {
                    
                      return compose()
                        .use(validateJwt)
                        .use(function (req, res, next) {
                    Severity: Minor
                    Found in app/templates/server/auth(auth)/auth.service.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