syntheticore/declaire

View on GitHub

Showing 76 of 76 total issues

Function Evaluator has a Cognitive Complexity of 216 (exceeds 5 allowed). Consider refactoring.
Open

var Evaluator = function(topNode, viewModels, parseTrees, interface, mainModel) {

  // Replace all mustaches in text with the value at their paths
  var resolveMustaches = function(text, scope, node, cb) {
    // Collect mustaches in reverse order
Severity: Minor
Found in src/evaluator.js - About 4 days 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 Evaluator has 683 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Evaluator = function(topNode, viewModels, parseTrees, interface, mainModel) {

  // Replace all mustaches in text with the value at their paths
  var resolveMustaches = function(text, scope, node, cb) {
    // Collect mustaches in reverse order
Severity: Major
Found in src/evaluator.js - About 3 days to fix

    File evaluator.js has 688 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var _ = require('./utils.js');
    var Scope = require('./scope.js');
    
    
    // Renders a parse tree from <topNode> downward and emits either
    Severity: Major
    Found in src/evaluator.js - About 1 day to fix

      Function evaluate has 306 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          evaluate: function(node, scope, preFormated) {
            var self = this;
            var frag = interface.createFragment();
      
            var recurse = function(frag, scope, pre) {
      Severity: Major
      Found in src/evaluator.js - About 1 day to fix

        Function StreamInterface has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
        Open

        var StreamInterface = function() {
          var pending = 0;
          var streamCb;
          var topNode;
        
        
        Severity: Minor
        Found in src/serverStreamInterface.js - About 1 day 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 ServerApplication has 238 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var ServerApplication = function(options) {
          // Create express app
          var expressApp = express();
          
          var environment = expressApp.get('env');
        Severity: Major
        Found in src/serverApplication.js - About 1 day to fix

          Function Instance has 217 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var Instance = function() {
            var inst = {
              klass: 'Instance',
              model: null,
              id: null,
          Severity: Major
          Found in src/model.js - About 1 day to fix

            Function Instance has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
            Open

            var Instance = function() {
              var inst = {
                klass: 'Instance',
                model: null,
                id: null,
            Severity: Minor
            Found in src/model.js - About 1 day 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 Query has 135 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var Query = function(modelOrCollection, query, options) {
              query = query || {};
              options = options || {};
            
              var allCache;
            Severity: Major
            Found in src/query.js - About 5 hrs to fix

              Function StreamInterface has 108 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var StreamInterface = function() {
                var pending = 0;
                var streamCb;
                var topNode;
              
              
              Severity: Major
              Found in src/serverStreamInterface.js - About 4 hrs to fix

                File model.js has 334 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                var Query = require('./query.js');
                var Collection = require('./collection.js');
                var _ = require('./utils.js');
                
                
                
                Severity: Minor
                Found in src/model.js - About 4 hrs to fix

                  Function ClientDataInterface has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var ClientDataInterface = function(model) {
                    var localStore = ClientStore(model.name);
                    var url = model.url();
                    var cache = {};
                    
                  Severity: Major
                  Found in src/clientDataInterface.js - About 3 hrs to fix

                    Function Query has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var Query = function(modelOrCollection, query, options) {
                      query = query || {};
                      options = options || {};
                    
                      var allCache;
                    Severity: Minor
                    Found in src/query.js - About 3 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 createDOMElement has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        createDOMElement: function(tag, id, classes, attributes) {
                          return {
                            tag: tag,
                            id: id,
                            className: classes ? classes.join(' ') : '',
                    Severity: Major
                    Found in src/serverStreamInterface.js - About 3 hrs to fix

                      Function Scope has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                      var Scope = function() {
                        var layers = [];
                      
                        return {
                          layers: layers,
                      Severity: Minor
                      Found in src/scope.js - About 3 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 LocalStore has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var LocalStore = function(modelName) {
                        // Iterate all items in local storage belonging to our model
                        var all = function(cb) {
                          for(var i = 0; i < localStorage.length; i++) {
                            var key = localStorage.key(i);
                      Severity: Major
                      Found in src/clientStore.js - About 3 hrs to fix

                        Function Scope has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var Scope = function() {
                          var layers = [];
                        
                          return {
                            layers: layers,
                        Severity: Major
                        Found in src/scope.js - About 3 hrs to fix

                          Function ClientApplication has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          var ClientApplication = function() {
                             // Save view model declarations for lookup in templates
                            var viewModels = {};
                          
                            // Create main model singleton instance
                          Severity: Major
                          Found in src/clientApplication.js - About 3 hrs to fix

                            Function Collection has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            var Collection = function(array) {
                              if(array && array.klass == 'Collection') return array;
                              var col = {
                                klass: 'Collection',
                                items: [],
                            Severity: Major
                            Found in src/collection.js - About 3 hrs to fix

                              Function parseStatement has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                parseStatement: function(line) {
                                  var m;
                                  var out;
                                  // if
                                  if(m = line.match(/{{if\s+(.+)}}/)) {
                              Severity: Major
                              Found in src/parser.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language