Showing 6 of 8 total issues
Function exports
has 254 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(options) {
if (!_.isObject(options)) {
options = {};
}
Function exports
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(options) {
if (!_.isObject(options)) {
options = {};
}
- Read upRead up
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
Open
VDoc.prototype = (function() {
var _initStates = function _initStates(doc, repository) {
this.doc = doc || null;
this.commits = repository.commits || null;
File changeset.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
var accessors = require('./accessors');
var _ = require('./utils');
Function _diffArray
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _diffArray = function _diffArray(array1, array2, path) {
var changeset = [];
var getIndexForValue = _buildValueToIndexMap(array1);
var distanceTable = _makeDistanceTable(array1, array2);
Function prototype
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
VDoc.prototype = (function() {
var _initStates = function _initStates(doc, repository) {
this.doc = doc || null;
this.commits = repository.commits || null;
- Read upRead up
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"