SungardAS/condensation

View on GitHub

Showing 31 of 39 total issues

Function buildHelper has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function buildHelper(particleName, options) {

  var opts = _.merge({
    wrapLogicalId: true
  },options);
Severity: Minor
Found in lib/condensation/template-helpers/sections/_buildHelper.js - About 6 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 condense has 111 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Condensation.prototype.condense = function condense() {
  var self = this;
  var options = this.options;
  var gulp = this.gulp;

Severity: Major
Found in lib/condensation/index.js - About 4 hrs to fix

    Function buildHelper has 106 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function buildHelper(particleName, options) {
    
      var opts = _.merge({
        wrapLogicalId: true
      },options);
    Severity: Major
    Found in lib/condensation/template-helpers/sections/_buildHelper.js - About 4 hrs to fix

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

      module.exports = function(s3opts,distPath,awsS3) {
        var self = this;
      
        var templateData = {};
        var urlString = [awsS3.endpoint.href,path.posix.join(s3opts.aws.bucket,s3opts.prefix)].join('');
      Severity: Major
      Found in lib/condensation/tasks/build.js - About 4 hrs to fix

        Function helper has 100 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var helper = function(cModule,pPath,hArgs,hOpts,cOpts) {
        
            var engine = cOpts.handlebars;
            var data = cOpts.handlebars.createFrame(hOpts.data || {});
        
        
        Severity: Major
        Found in lib/condensation/template-helpers/sections/_buildHelper.js - About 4 hrs to fix

          Function loadParticle has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

          ParticleLoader.prototype.loadParticle = function(type,cModule,pPath,options) {
            var loadError = new VError("particle load error");
          
            var opts = _.merge({
              parentFile: null,
          Severity: Minor
          Found in lib/condensation/loaders/particle-loader.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

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

            var stream = es.readable(function(esCount,streamCb) {
              var readable = this;
          
              var totalCount = 0;
              var lastTotalCount = 0;
          Severity: Major
          Found in lib/condensation/tasks/build.js - About 2 hrs to fix

            Function loadParticle has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            ParticleLoader.prototype.loadParticle = function(type,cModule,pPath,options) {
              var loadError = new VError("particle load error");
            
              var opts = _.merge({
                parentFile: null,
            Severity: Major
            Found in lib/condensation/loaders/particle-loader.js - About 2 hrs to fix

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

              var processTemplate = function(conf) {
              
                var engine = conf.cOpts.handlebars;
                var templateContent = '';
              
              
              Severity: Major
              Found in lib/condensation/template-helpers/sections/_buildHelper.js - About 2 hrs to fix

                Function runStreams has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var runStreams = function(globs,options) {
                      var s = gulp.src(globs,options)
                      .pipe(cache(self.options.projectName+distPath))
                      .pipe(through.obj(function(file,enc,cb) {
                        file._templateFormat = cUtil.detectFormat({
                Severity: Major
                Found in lib/condensation/tasks/build.js - About 2 hrs to fix

                  Function loadHelper has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var loadHelper = function(helperDefinition,options) {
                    var cOpts = _.merge({
                      handlebars: Handlebars,
                      projectDir: process.cwd(),
                      particleLoader: null,
                  Severity: Minor
                  Found in lib/condensation/loaders/template-helper-loader.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

                  Function layout has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var helper = function layout(cModule,pPath,hArgs,hOpts,cOpts) {
                  
                    var engine = cOpts.handlebars;
                    var data = engine.createFrame(hOpts.data || {});
                    data._isLayout = true;
                  Severity: Minor
                  Found in lib/condensation/template-helpers/layout.js - About 1 hr to fix

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

                    module.exports = function(options) {
                    
                      var helpers = {
                        arrayify: require('../template-helpers/arrayify'),
                        assetPath: loadTemplateHelper(require('../template-helpers/assetPath'),options),
                    Severity: Minor
                    Found in lib/condensation/loaders/all-helpers.js - About 1 hr to fix

                      Function exports has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function(s3opts,distPath,awsS3) {
                        var self = this;
                      
                        var templateData = {};
                        var urlString = [awsS3.endpoint.href,path.posix.join(s3opts.aws.bucket,s3opts.prefix)].join('');
                      Severity: Minor
                      Found in lib/condensation/tasks/build.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 validator has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function validator(opts) {
                        var cloudformation = new AWS.CloudFormation(opts);
                        // creating a stream through which each file will pass
                        var stream = through.obj(function(file, enc, cb) {
                          var retry = backoff.exponential();
                      Severity: Minor
                      Found in lib/gulp-plugins/gulp-cf-validate.js - About 1 hr to fix

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

                        var loadHelper = function(helperDefinition,options) {
                          var cOpts = _.merge({
                            handlebars: Handlebars,
                            projectDir: process.cwd(),
                            particleLoader: null,
                        Severity: Minor
                        Found in lib/condensation/loaders/template-helper-loader.js - About 1 hr to fix

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

                          var ParticleLoader = function(options) {
                            this.root = options.root;
                            this.registry = {};
                            this.typeMap = {
                              'asset': 'assets',
                          Severity: Minor
                          Found in lib/condensation/loaders/particle-loader.js - About 1 hr to fix

                            Function stream has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              var stream = through.obj(function(file, enc, cb) {
                                var retry = backoff.exponential();
                                retry.failAfter(20);
                            
                                retry.on('ready', function(number,delay) {
                            Severity: Minor
                            Found in lib/gulp-plugins/gulp-cf-validate.js - About 1 hr to fix

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

                              exports.parse = function parse(str,options) {
                                var opts = _.merge({}, options);
                              
                              
                                if (_.isPlainObject(str)) {
                              Severity: Minor
                              Found in lib/condensation/util.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 cValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                              module.exports = function cValue(str,options) {
                                options = _.merge({
                                  hash: {
                                    forceNumber: false
                                  }
                              Severity: Minor
                              Found in lib/condensation/template-helpers/cValue.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

                              Severity
                              Category
                              Status
                              Source
                              Language