Showing 6 of 23 total issues
Function ModelWrapper
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ModelWrapper = function (schema, obj, validators, options) {
var basedOn = obj, data = obj || {}, that = this,
lastErrors,
createSubModels = options && options.createSubModels,
File ModelFactory.js
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* @class ModelFactory
* Factory for creating schema-based models. If Backbone exists, the factory
* will create a schema-based Backbone model.
*/
Function exports
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
src: ['js/**/*.js', 'test/**/*.js', 'example/**/*.js', '!node_modules/**/*.*', '!**/lib/**/*.js', '!js/declare.js'],
Function indexOf
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
indexOf: function (val, array) {
'use strict';
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (obj, fromIndex) {
if (fromIndex === 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"
Further reading
Function module
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var module = function (config) {
this.message = {code: 0, message: 'Invalid number'};
util.mixin(this, config);
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',