Showing 31 of 109 total issues
Function default
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (file, searchPaths) {
if (!searchPaths) {
throw new Error('No searchPaths specified.');
}
var result = null;
Function format
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
JsonApiFormat.prototype.format = function format(model) {
var includedRelations = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
var mode = arguments.length <= 2 || arguments[2] === undefined ? 'read' : arguments[2];
var store = this.store;
Function process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
process (input, opts={}) {
const {singleResult, relations, mode} = opts;
let links;
if (mode === 'relation') {
links = this._relationshipLinks(input.sourceModel, input.relationName);
- 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 relate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function relate(model, relationName, data, mode, transaction) {
Function readForRelated
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function readForRelated (mode, sourceModel, id, relation, query) {
Function readForRelated
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function readForRelated(mode, sourceModel, id, relation, query) {
Function relate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function relate (model, relationName, data, mode, transaction) {
Function default
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function(request, endpoint) {
var err, isValidType, id;
var data = request.body.data;
// this is such horrible, horrible bullshit
- 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 _createClass
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
- 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 default
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function(model) {
if (!model) {
throw Kapow(404, 'Unable to locate model.');
}
- 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 _createClass
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
- 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"