builtinnya/jsonvc

View on GitHub

Showing 6 of 8 total issues

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

module.exports = function(options) {
  if (!_.isObject(options)) {
    options = {};
  }

Severity: Major
Found in src/changeset.js - About 1 day to fix

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

    module.exports = function(options) {
      if (!_.isObject(options)) {
        options = {};
      }
    
    
    Severity: Minor
    Found in src/changeset.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 prototype has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    VDoc.prototype = (function() {
    
      var _initStates = function _initStates(doc, repository) {
        this.doc = doc || null;
        this.commits = repository.commits || null;
    Severity: Major
    Found in src/vdoc.js - About 4 hrs to fix

      File changeset.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      var accessors = require('./accessors');
      var _ = require('./utils');
      
      
      Severity: Minor
      Found in src/changeset.js - About 2 hrs to fix

        Function _diffArray has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var _diffArray = function _diffArray(array1, array2, path) {
            var changeset = [];
        
            var getIndexForValue = _buildValueToIndexMap(array1);
            var distanceTable = _makeDistanceTable(array1, array2);
        Severity: Major
        Found in src/changeset.js - About 2 hrs to fix

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

          VDoc.prototype = (function() {
          
            var _initStates = function _initStates(doc, repository) {
              this.doc = doc || null;
              this.commits = repository.commits || null;
          Severity: Minor
          Found in src/vdoc.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

          Severity
          Category
          Status
          Source
          Language