syntheticore/declaire

View on GitHub

Showing 70 of 76 total issues

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

var ViewModel = function(name, reference, constructor) {
  var model = Model('_view', reference);
  return {
    klass: 'ViewModel',
    name: name,
Severity: Minor
Found in src/viewModel.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 separateMethods has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

var separateMethods = function(reference) {
  var ret = {
    defaults: {},
    methods: {},
    collections: {},
Severity: Minor
Found in src/model.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 parseAttribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  parseAttribute: function(str) {
    var attr = {type: 'static', value: str};
    // Dynamic attribute
    if(str[0] == '{') {
      // Trim off curlies
Severity: Minor
Found in src/parser.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

Avoid too many return statements within this function.
Open

          if(op == '<=') return a <= b;
Severity: Major
Found in src/evaluator.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

              if(op == '>=') return a >= b;
    Severity: Major
    Found in src/evaluator.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                return obj[seg];
      Severity: Major
      Found in src/scope.js - About 30 mins to fix

        Function Model has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        var Model = function(dbCollection, reference, constructor) {
          var ref = separateMethods(reference);
          var model = {
            klass: 'Model',
            name: dbCollection,
        Severity: Minor
        Found in src/model.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

        Function makeCollections has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        Collection.makeCollections = function(data, inst) {
          return _.map(data, function(value, key) {
            if(Array.isArray(value)) {
              var col = Collection(value);
              if(inst) col.on('change', function() {
        Severity: Minor
        Found in src/collection.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

        Function UndoManager has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        var UndoManager = function(items) {
          var milestones = [{}];
          var reverseIndex = 0;
          var dontRecord = false;
        
        
        Severity: Minor
        Found in src/undoManager.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

        Function Router has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        var Router = function() {
          var listeners = {};
          var suppressNextPopstate = false;
        
          var scrollTo = function(id) {
        Severity: Minor
        Found in src/clientRouter.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