adamrenklint/asimov-static

View on GitHub

Showing 59 of 136 total issues

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

  'run': function (src, params) {

    var self = this;

    if (typeof src !== 'string') {
Severity: Minor
Found in lib/helpers/image.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 recursiveDelete has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  'recursiveDelete': function (path) {

    var self = this;

    if (!self.pathExists(path)) return;
Severity: Minor
Found in lib/core/Filesystem.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 html has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  'html': function (tagName, data) {

    var self = this;

    if (!tagName) {
Severity: Minor
Found in lib/helpers/Helper.js - About 1 hr to fix

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

      'initialize': function () {
    
        var self = this;
        _super.initialize.apply(self, arguments);
    
    
    Severity: Minor
    Found in lib/_commands/Create.js - About 1 hr to fix

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

        'parse': function (model, raw, dependencies) {
      
          var self = this;
          var attributes = model.attributes;
          raw = raw || attributes.raw;
      Severity: Minor
      Found in lib/parsers/ScriptParser.js - About 1 hr to fix

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

          save: function(key, val, options) {
            var attrs, method, xhr, attributes = this.attributes;
        
            // Handle both `"key", value` and `{key: value}` -style arguments.
            if (key == null || typeof key === 'object') {
        Severity: Minor
        Found in lib/core/Model.js - About 1 hr to fix

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

            'getPathType': function (path) {
          
              var self = this;
          
              _.each(self.options.paths.initializers, function (initializersPath) {
          Severity: Minor
          Found in lib/watcher/Watcher.js - About 1 hr to fix

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

              'lazyLoadMiddleware': function (req, res, next) {
            
                var self = this;
            
                var middleware = self.resolveMiddleware(req.url) || [];
            Severity: Minor
            Found in lib/server/Server.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 parsePosition has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              'parsePosition': function (string) {
            
                var self = this;
                var parts = string.split('/');
                var index = 0;
            Severity: Minor
            Found in lib/nodes/PageNode.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 fetch has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              'fetch': function (paths) {
            
                var self = this;
                var started = new Date();
                var deferred = self.deferred();
            Severity: Minor
            Found in lib/core/FilesystemCollection.js - About 1 hr to fix

              Function fetch has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                'fetch': function (path, logger) {
              
                  var self = this;
                  path = path || self.attributes.path;
                  var deferred = self.deferred();
              Severity: Minor
              Found in lib/render/TemplateHelperModel.js - About 1 hr to fix

                Function run has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  'run': function (href, innerText, params, block) {
                
                    var self = this;
                
                    if (typeof href !== 'string') {
                Severity: Minor
                Found in lib/helpers/link.js - About 1 hr to fix

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

                    'generate': function () {
                  
                      if (process.env.USE_STATIC_PUBLIC) return;
                      
                      var self = this;
                  Severity: Minor
                  Found in lib/initializers/Sitemap.js - About 1 hr to fix

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

                      'parseRawMeta': function (raw, meta) {
                    
                        var self = this;
                        meta = meta || {};
                    
                    
                    Severity: Minor
                    Found in lib/nodes/MetaNode.js - About 1 hr to fix

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

                        'parse': function (model, raw, dependencies) {
                      
                          var self = this;
                          var attributes = model.attributes;
                          raw = self.assertAttributes(attributes, raw);
                      Severity: Minor
                      Found in lib/parsers/StyleSheetParser.js - About 1 hr to fix

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

                          'parse': function (model, raw, dependencies) {
                        
                            var self = this;
                            var attributes = model.attributes;
                            raw = self.assertAttributes(attributes, raw);
                        Severity: Minor
                        Found in lib/parsers/StyleSheetParser.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 bootstrap has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          'bootstrap': function () {
                        
                            var self = this;
                            var meta = self.options.meta;
                            var deferred = self.deferred();
                        Severity: Minor
                        Found in lib/core/Loader.js - About 1 hr to fix

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

                            'parseUrl': function (path) {
                          
                              var self = this;
                          
                              if (!path) {
                          Severity: Minor
                          Found in lib/nodes/PageNode.js - About 1 hr to fix

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

                              'lazyLoadMiddleware': function (req, res, next) {
                            
                                var self = this;
                            
                                var middleware = self.resolveMiddleware(req.url) || [];
                            Severity: Minor
                            Found in lib/server/Server.js - About 1 hr to fix

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

                                  function renderValues (value, key, collection) {
                              
                                    if (key === 'page' || key === 'raw') return;
                              
                                    if (typeof value === 'string') {
                              Severity: Minor
                              Found in lib/nodes/PageNodesCollection.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language