Showing 31 of 109 total issues
Function JsonApiFormat
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
var JsonApiFormat = (function () {
/**
* The constructor.
*
Function JsonApiFormat
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
var JsonApiFormat = (function () {
/**
* The 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 RequestHandler
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
var RequestHandler = (function () {
/**
The constructor.
@constructs RequestHandler
Function RequestHandler
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
var RequestHandler = (function () {
/**
The constructor.
@constructs RequestHandler
- 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 Controller
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Controller = (function () {
Controller.extend = function extend() {
var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
return (function (_ref) {
Function PayloadHandler
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PayloadHandler = (function () {
function PayloadHandler(formatter) {
_classCallCheck(this, PayloadHandler);
this.formatter = formatter;
Function Application
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Application = (function () {
function Application(opts) {
_classCallCheck(this, Application);
this._resources = {};
Function Application
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
var Application = (function () {
function Application(opts) {
_classCallCheck(this, Application);
this._resources = {};
- 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 Controller
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
var Controller = (function () {
Controller.extend = function extend() {
var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
return (function (_ref) {
- 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 _interopRequireWildcard
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
- 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 PayloadHandler
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
var PayloadHandler = (function () {
function PayloadHandler(formatter) {
_classCallCheck(this, PayloadHandler);
this.formatter = formatter;
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
export default function (file, searchPaths) {
if (!searchPaths) {
throw new Error('No searchPaths specified.');
}
var result = 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 process
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
JsonApiFormat.prototype.process = function process(input) {
var _this = this;
var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var singleResult = opts.singleResult;
Function error
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
PayloadHandler.prototype.error = function error(errs, defaultErr) {
var resp;
defaultErr = defaultErr || 400;
errs = errs || [_kapow2['default'](defaultErr)];
Function destructure
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function destructure(model) {
var params = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var relationships = params.relationships || {};
var relationshipNames = _lodash2['default'].keys(relationships);
Function error
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
error (errs, defaultErr) {
var resp;
defaultErr = defaultErr || 400;
errs = errs || [Kapow(defaultErr)];
Function validate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
validate (request) {
var err;
var validators = [];
Function destructure
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function destructure (model, params={}) {
const relationships = params.relationships || {};
const relationshipNames = _.keys(relationships);
const allRels = allRelations(model);
const toOneRelsMap = toOneRelations(model);
Function validate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
validate (request) {
var err;
var validators = [];
- 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 read
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function read(model) {
var query = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var mode = arguments.length <= 2 || arguments[2] === undefined ? 'read' : arguments[2];
return _columns2['default'](model).then(function (modelColumns) {